Skip to content

Instantly share code, notes, and snippets.

@notmasteryet
Created September 23, 2010 22:59
Show Gist options
  • Save notmasteryet/594560 to your computer and use it in GitHub Desktop.
Save notmasteryet/594560 to your computer and use it in GitHub Desktop.
diff -r 54d40057f55a content/media/nsAudioAvailableEventManager.cpp
--- a/content/media/nsAudioAvailableEventManager.cpp Thu Sep 23 20:09:00 2010 -0700
+++ b/content/media/nsAudioAvailableEventManager.cpp Thu Sep 23 22:13:31 2010 -0500
@@ -219,9 +219,10 @@
(mSignalBufferLength - mSignalBufferPosition) * sizeof(float));
// Force this last event to go now.
+ PRUint64 time = aEndTime - MILLISECONDS_PER_SECOND * mSignalBufferPosition / mSamplesPerSecond;
nsCOMPtr<nsIRunnable> lastEvent =
new nsAudioAvailableEventRunner(mDecoder, mSignalBuffer.forget(),
- mSignalBufferLength, aEndTime);
+ mSignalBufferLength, time);
NS_DispatchToMainThread(lastEvent, NS_DISPATCH_NORMAL);
mSignalBufferPosition = 0;
diff -r 54d40057f55a content/media/nsBuiltinDecoderStateMachine.cpp
--- a/content/media/nsBuiltinDecoderStateMachine.cpp Thu Sep 23 20:09:00 2010 -0700
+++ b/content/media/nsBuiltinDecoderStateMachine.cpp Thu Sep 23 22:13:31 2010 -0500
@@ -437,9 +437,9 @@
// time.
missingSamples = NS_MIN(static_cast<PRInt64>(PR_UINT32_MAX), missingSamples);
audioDuration += PlaySilence(static_cast<PRUint32>(missingSamples),
- channels, sampleTime);
+ channels, playedSamples);
} else {
- audioDuration += PlayFromAudioQueue(sampleTime, channels);
+ audioDuration += PlayFromAudioQueue(playedSamples, channels);
}
{
MonitorAutoEnter mon(mDecoder->GetMonitor());
diff -r 54d40057f55a content/media/test/test_a4_tone.html
--- a/content/media/test/test_a4_tone.html Thu Sep 23 20:09:00 2010 -0700
+++ b/content/media/test/test_a4_tone.html Thu Sep 23 22:13:31 2010 -0500
@@ -178,7 +178,7 @@
spectrumMaxs.push({ value: maxValue, index: maxIndex, time: (currentSampleOffset / testFileSampleRate) });
if( (typeof event.time !== "number") ||
- (Math.abs(event.time - currentSampleOffset / testFileSampleRate) > 0.01) ) {
+ (Math.abs(event.time - currentSampleOffset / testFileSampleRate) >= 0.001) ) {
isTimePropertyValid = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment