Closed Bug 598829 Opened 14 years ago Closed 14 years ago

Gap in media is incorrectly timestamped for AudioAvailable

Categories

(Core :: Audio/Video, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: cpearce, Unassigned)

References

Details

I've discovered a problem with the AudioAvailable code in nsBuiltinDecoder::AudioLoop(): I think this code [1]: audioDuration += PlaySilence(static_cast<PRUint32>(missingSamples), channels, sampleTime); Should be: audioDuration += PlaySilence(static_cast<PRUint32>(missingSamples), channels, playedSamples); At that call site, we're injecting missingSamples samples of silence between the end of the last sound sample, and the start of the next chunk of sound samples. sampleTime is the number of samples which the *next* queued SoundData's audio starts at, but we need to inject missingSamples samples in order for playback to reach that position. Thus sampleTime is actually the *end* of the silence chunk which PlaySilence() will inject here, not the *start* as expected by PlaySilence(). playedSamples is the start of the silence chunk (i.e. the end of the last played chunk). [1] http://mxr.mozilla.org/mozilla-central/source/content/media/nsBuiltinDecoderStateMachine.cpp#440
Depends on: 598812
Fixed in bug 598812.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.