Chromium Code Reviews| Index: media/blink/webmediaplayer_impl.cc | 
| diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc | 
| index cd80f3ab4a568cb32eb59f4aedf8b0bdb818135d..68fab8b311e55ca2cfa925d6c1df188c635a9e0b 100644 | 
| --- a/media/blink/webmediaplayer_impl.cc | 
| +++ b/media/blink/webmediaplayer_impl.cc | 
| @@ -15,6 +15,7 @@ | 
| #include "base/debug/alias.h" | 
| #include "base/debug/crash_logging.h" | 
| #include "base/debug/trace_event.h" | 
| +#include "base/float_util.h" | 
| #include "base/message_loop/message_loop_proxy.h" | 
| #include "base/metrics/histogram.h" | 
| #include "base/single_thread_task_runner.h" | 
| @@ -492,14 +493,14 @@ blink::WebTimeRanges WebMediaPlayerImpl::seekable() const { | 
| if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata) | 
| return blink::WebTimeRanges(); | 
| - // We don't support seeking in streaming media. | 
| - if (data_source_ && data_source_->IsStreaming()) | 
| - return blink::WebTimeRanges(); | 
| - | 
| - // If we have a duration then use [0, duration] as the seekable range. | 
| - const double seekable_end = duration(); | 
| - if (!seekable_end) | 
| - return blink::WebTimeRanges(); | 
| + // We don't support seeking in streaming media except for a seek to zero when | 
| + // the source has a known duration. | 
| + double seekable_end = duration(); | 
| + if (data_source_ && data_source_->IsStreaming()) { | 
| 
 
philipj_slow
2014/10/01 09:37:50
Can you DCHECK(base::IsFinite(seekable_end) && see
 
DaleCurtis
2014/10/06 23:55:42
I've reworked this to look more like the android c
 
 | 
| + if (!base::IsFinite(seekable_end)) | 
| + return blink::WebTimeRanges(); | 
| + seekable_end = 0.0; | 
| + } | 
| blink::WebTimeRange seekable_range(0.0, seekable_end); | 
| return blink::WebTimeRanges(&seekable_range, 1); |