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 291481 fcbbc5261056bb9edeb00121870db2e73aaa8ee4
parent 291480 70132ea00d708cd89e146bd8202beba2636f8a41
child 291482 4bf317aa1f747b17bba3d293972617bfa1d7aa2b
push id8711
push usercbook@mozilla.com
push dateThu, 12 Nov 2015 10:43:53 +0000
treeherdermozilla-aurora@0e9c6096f7e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, lizzard
bugs1220033
milestone44.0a2
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
@@ -80,17 +80,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;
 }