Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: webkit/media/android/webmediaplayer_android.cc

Issue 15927003: Fix MediaPlayerDelegate error handling so it passes the webkitmediasource-errors.html LayoutTest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/media/android/media_source_delegate.cc ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/android/webmediaplayer_android.cc
diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc
index cc88632bcafdfbe11e9ac1bca64e1c9cf80ef89d..dabb584fa56e8383f6d05cc99baa26f4a706423d 100644
--- a/webkit/media/android/webmediaplayer_android.cc
+++ b/webkit/media/android/webmediaplayer_android.cc
@@ -520,7 +520,15 @@ void WebMediaPlayerAndroid::OnMediaSeekRequest(base::TimeDelta time_to_seek,
void WebMediaPlayerAndroid::UpdateNetworkState(
WebMediaPlayer::NetworkState state) {
- network_state_ = state;
+ if (ready_state_ == WebMediaPlayer::ReadyStateHaveNothing &&
+ (state == WebMediaPlayer::NetworkStateNetworkError ||
+ state == WebMediaPlayer::NetworkStateDecodeError)) {
+ // Any error that occurs before reaching ReadyStateHaveMetadata should
+ // be considered a format error.
+ network_state_ = WebMediaPlayer::NetworkStateFormatError;
+ } else {
+ network_state_ = state;
+ }
client_->networkStateChanged();
}
« no previous file with comments | « webkit/media/android/media_source_delegate.cc ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698