Index: content/renderer/media/android/webmediaplayer_android.cc |
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc |
index af0d25b27bd433d216335118bc5fad3ad8d7f163..28f986b26b51e47ad6dfd5134f21acedc0bcc230 100644 |
--- a/content/renderer/media/android/webmediaplayer_android.cc |
+++ b/content/renderer/media/android/webmediaplayer_android.cc |
@@ -461,9 +461,6 @@ double WebMediaPlayerAndroid::duration() const { |
if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing) |
return std::numeric_limits<double>::quiet_NaN(); |
- // TODO(wolenetz): Correctly handle durations that MediaSourcePlayer |
- // considers unseekable, including kInfiniteDuration(). |
acolwell GONE FROM CHROMIUM
2014/01/14 16:36:40
This comment should not be removed since this code
amogh.bihani
2014/01/15 06:33:02
initially when i had stopped duration to be more t
amogh.bihani
2014/01/15 06:33:02
Done.
|
- // See http://crbug.com/248396 |
return duration_.InSecondsF(); |
} |
@@ -502,8 +499,7 @@ double WebMediaPlayerAndroid::maxTimeSeekable() const { |
if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata) |
return 0.0; |
acolwell GONE FROM CHROMIUM
2014/01/14 16:36:40
You also need the following to properly handle cli
amogh.bihani
2014/01/15 06:33:02
Done.
|
- // TODO(hclam): If this stream is not seekable this should return 0. |
- return duration(); |
+ return std::min(std::numeric_limits<int32>max(), duration()); |
} |
bool WebMediaPlayerAndroid::didLoadingProgress() const { |
@@ -619,9 +615,6 @@ void WebMediaPlayerAndroid::OnMediaMetadataChanged( |
// Update duration, if necessary, prior to ready state updates that may |
// cause duration() query. |
- // TODO(wolenetz): Correctly handle durations that MediaSourcePlayer |
- // considers unseekable, including kInfiniteDuration(). |
- // See http://crbug.com/248396 |
if (!ignore_metadata_duration_change_ && duration_ != duration) { |
duration_ = duration; |
@@ -828,11 +821,15 @@ void WebMediaPlayerAndroid::OnDurationChanged(const base::TimeDelta& duration) { |
// Only MSE |player_type_| registers this callback. |
DCHECK_EQ(player_type_, MEDIA_PLAYER_TYPE_MEDIA_SOURCE); |
+ // MediaSourcePlayer assumes duration more than 2^31 as unseekable |
+ // because java player uses 32-bit integer for time at millisecond resolution |
+ if (duration >= |
acolwell GONE FROM CHROMIUM
2014/01/14 16:36:40
This prevents Blink from being notified of the new
amogh.bihani
2014/01/15 06:33:02
Done.
|
+ base::TimeDelta::FromMilliseconds(std::numeric_limits<int32>max())) { |
+ return; |
+ } |
+ |
// Cache the new duration value and trust it over any subsequent duration |
// values received in OnMediaMetadataChanged(). |
- // TODO(wolenetz): Correctly handle durations that MediaSourcePlayer |
- // considers unseekable, including kInfiniteDuration(). |
- // See http://crbug.com/248396 |
duration_ = duration; |
ignore_metadata_duration_change_ = true; |