Skip to content

Commit

Permalink
Bug 1386478 - don't cap the return value of GetEndTime(). r=jya
Browse files Browse the repository at this point in the history
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

--HG--
extra : rebase_source : 20004ae6c6d4e15dc8aeebf646efc62342514d24
  • Loading branch information
jwwang committed Aug 2, 2017
1 parent 7c6e2bd commit 108a5c3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions dom/media/mediasink/AudioSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ AudioSink::GetEndTime() const
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>
Expand Down

0 comments on commit 108a5c3

Please sign in to comment.