From 2cc8fbe2b413e6f3dbe0cd9d7231421b21f52ed4 Mon Sep 17 00:00:00 2001 From: Matthew Gregan Date: Wed, 3 Jun 2009 10:32:11 +1200 Subject: [PATCH] Bug 494116 - Use system audio timer for a/v sync on Windows. r=chris.double, sr=roc --- content/media/video/src/nsAudioStream.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/media/video/src/nsAudioStream.cpp b/content/media/video/src/nsAudioStream.cpp index c7a45d6710d..0d237c4c0e4 100644 --- a/content/media/video/src/nsAudioStream.cpp +++ b/content/media/video/src/nsAudioStream.cpp @@ -242,10 +242,13 @@ float nsAudioStream::GetPosition() if (!mAudioHandle) return -1.0; + sa_position_t positionType = SA_POSITION_WRITE_SOFTWARE; +#if defined(XP_WIN) + positionType = SA_POSITION_WRITE_HARDWARE; +#endif PRInt64 position = 0; if (sa_stream_get_position(static_cast(mAudioHandle), - SA_POSITION_WRITE_SOFTWARE, - &position) == SA_SUCCESS) { + positionType, &position) == SA_SUCCESS) { return (position / float(mRate) / mChannels / sizeof(short)); }