Index: webkit/media/android/webmediaplayer_android.cc |
diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc |
index 6c0722cee6fd16ab5f4f856aa55c805e21593d73..ef8248ee9af952df578271e955df160667a4420b 100644 |
--- a/webkit/media/android/webmediaplayer_android.cc |
+++ b/webkit/media/android/webmediaplayer_android.cc |
@@ -41,6 +41,7 @@ WebMediaPlayerAndroid::WebMediaPlayerAndroid( |
ready_state_(WebMediaPlayer::ReadyStateHaveNothing), |
is_playing_(false), |
needs_establish_peer_(true), |
+ has_size_info_(false), |
stream_texture_factory_(factory) { |
main_loop_->AddDestructionObserver(this); |
if (manager_) |
@@ -130,8 +131,8 @@ bool WebMediaPlayerAndroid::totalBytesKnown() { |
bool WebMediaPlayerAndroid::hasVideo() const { |
// If we have obtained video size information before, use it. |
- if (!natural_size_.isEmpty()) |
- return true; |
+ if (has_size_info_) |
+ return !natural_size_.isEmpty(); |
// TODO(qinmin): need a better method to determine whether the current media |
// content contains video. Android does not provide any function to do |
@@ -323,6 +324,7 @@ void WebMediaPlayerAndroid::OnMediaError(int error_type) { |
} |
void WebMediaPlayerAndroid::OnVideoSizeChanged(int width, int height) { |
+ has_size_info_ = true; |
Miguel Garcia
2012/11/29 20:28:02
shouldn't you check that width or height is > 0?
qinmin
2012/11/29 20:39:33
No, we don't. This is called by the android media
Miguel Garcia
2012/11/29 20:43:36
OK, makes sense
On 2012/11/29 20:39:33, qinmin w
|
if (natural_size_.width == width && natural_size_.height == height) |
return; |