Bug 1386478 - don't cap the return value of GetEndTime().
A chained ogg file contains multiple streams and timestamps will not
monolithically increase. The current code will cap AudioEndTime()
to the end time of the 1st stream and currentTime won't be updated
correctly when playback position reaches the 2nd stream or later ones.
http://searchfox.org/mozilla-central/rev/bbc1c59e460a27b20929b56489e2e55438de81fa/dom/media/MediaDecoderStateMachine.cpp#3636-3637
MozReview-Commit-ID: DbIspYmEjVv
--- a/dom/media/mediasink/AudioSink.cpp
+++ b/dom/media/mediasink/AudioSink.cpp
@@ -228,19 +228,17 @@ AudioSink::GetEndTime() const
MonitorAutoLock mon(mMonitor);
written = mWritten;
}
TimeUnit played = FramesToTimeUnit(written, mOutputRate) + mStartTime;
if (!played.IsValid()) {
NS_WARNING("Int overflow calculating audio end time");
return TimeUnit::Zero();
}
- // As we may be resampling, rounding errors may occur. Ensure we never get
- // past the original end time.
- return std::min(mLastEndTime, played);
+ return played;
}
UniquePtr<AudioStream::Chunk>
AudioSink::PopFrames(uint32_t aFrames)
{
class Chunk : public AudioStream::Chunk {
public:
Chunk(AudioData* aBuffer, uint32_t aFrames, AudioDataValue* aData)