diff options
author | trav90 <travawine@openmailbox.org> | 2017-09-14 02:57:30 -0500 |
---|---|---|
committer | trav90 <travawine@openmailbox.org> | 2017-09-14 02:57:30 -0500 |
commit | 014cd2675a9e4af9179922295f1d52bf019c26e0 (patch) | |
tree | 7e6201f85865a1532aefc1eab6813be09f88d2bc | |
parent | ea7dff47601b01892f2a0126c70cc9f4988ddc91 (diff) | |
download | palemoon-014cd2675a9e4af9179922295f1d52bf019c26e0.tar.gz |
[MP3] Constrain seek position getter to max duration
-rw-r--r-- | dom/media/MP3Demuxer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dom/media/MP3Demuxer.cpp b/dom/media/MP3Demuxer.cpp index e6878f9a2..c5d96a307 100644 --- a/dom/media/MP3Demuxer.cpp +++ b/dom/media/MP3Demuxer.cpp @@ -146,7 +146,11 @@ MP3TrackDemuxer::DemuxSample() { media::TimeUnit MP3TrackDemuxer::SeekPosition() const { - return Duration(mFrameIndex); + TimeUnit pos = Duration(mFrameIndex); + if (Duration() > TimeUnit()) { + pos = std::min(Duration(), pos); + } + return pos; } #endif |