Bug 1220033 - Fix HTMLMediaElement::seekable attribute for Mediasource. r=gerald, a=lizzard
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 11 Nov 2015 21:21:35 +1100
changeset 296704 84b0b59ed1d2
parent 296703 ba6b7797e925
child 296705 8c199302644e
push id5297
push usercbook@mozilla.com
push date2015-11-12 11:11 +0000
treeherdermozilla-beta@8c199302644e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, lizzard
bugs1220033
milestone43.0
Bug 1220033 - Fix HTMLMediaElement::seekable attribute for Mediasource. r=gerald, a=lizzard Interval is to start from 0 when duration is +infinity
dom/media/mediasource/MediaSourceDecoder.cpp
--- a/dom/media/mediasource/MediaSourceDecoder.cpp
+++ b/dom/media/mediasource/MediaSourceDecoder.cpp
@@ -77,17 +77,18 @@ MediaSourceDecoder::GetSeekable()
 
   media::TimeIntervals seekable;
   double duration = mMediaSource->Duration();
   if (IsNaN(duration)) {
     // Return empty range.
   } else if (duration > 0 && mozilla::IsInfinite(duration)) {
     media::TimeIntervals buffered = GetBuffered();
     if (buffered.Length()) {
-      seekable += media::TimeInterval(buffered.GetStart(), buffered.GetEnd());
+      seekable +=
+        media::TimeInterval(media::TimeUnit::FromSeconds(0), buffered.GetEnd());
     }
   } else {
     seekable += media::TimeInterval(media::TimeUnit::FromSeconds(0),
                                     media::TimeUnit::FromSeconds(duration));
   }
   MSE_DEBUG("ranges=%s", DumpTimeRanges(seekable).get());
   return seekable;
 }