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

Unified Diff: media/base/android/media_player_bridge.cc

Issue 1393673005: Fix an issue that an invalid surface could be passed to MediaPlayerBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years, 2 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 | « no previous file | ui/gl/android/scoped_java_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_player_bridge.cc
diff --git a/media/base/android/media_player_bridge.cc b/media/base/android/media_player_bridge.cc
index e043a7878df7efa29149b60a6842fc3d4831c21d..4ec4419ee00fe8ba2acdc79f187bad4e646b33ae 100644
--- a/media/base/android/media_player_bridge.cc
+++ b/media/base/android/media_player_bridge.cc
@@ -109,17 +109,16 @@ void MediaPlayerBridge::SetDuration(base::TimeDelta duration) {
}
void MediaPlayerBridge::SetVideoSurface(gfx::ScopedJavaSurface surface) {
- if (j_media_player_bridge_.is_null()) {
- if (!surface.IsEmpty())
- surface_ = surface.Pass();
+ surface_ = surface.Pass();
+
+ if (j_media_player_bridge_.is_null())
return;
- }
JNIEnv* env = base::android::AttachCurrentThread();
CHECK(env);
Java_MediaPlayerBridge_setSurface(
- env, j_media_player_bridge_.obj(), surface.j_surface().obj());
+ env, j_media_player_bridge_.obj(), surface_.j_surface().obj());
}
void MediaPlayerBridge::Prepare() {
« no previous file with comments | « no previous file | ui/gl/android/scoped_java_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698