am c4de6f81: Merge "MediaPlayer: properly handle released surfaces" into ics-mr0
* commit 'c4de6f81d4533acbfc162d051de480d474b72e76': MediaPlayer: properly handle released surfaces
This commit is contained in:
@@ -274,8 +274,14 @@ setVideoSurface(JNIEnv *env, jobject thiz, jobject jsurface, jboolean mediaPlaye
|
|||||||
sp<ISurfaceTexture> new_st;
|
sp<ISurfaceTexture> new_st;
|
||||||
if (jsurface) {
|
if (jsurface) {
|
||||||
sp<Surface> surface(Surface_getSurface(env, jsurface));
|
sp<Surface> surface(Surface_getSurface(env, jsurface));
|
||||||
new_st = surface->getSurfaceTexture();
|
if (surface != NULL) {
|
||||||
new_st->incStrong(thiz);
|
new_st = surface->getSurfaceTexture();
|
||||||
|
new_st->incStrong(thiz);
|
||||||
|
} else {
|
||||||
|
jniThrowException(env, "java/lang/IllegalArgumentException",
|
||||||
|
"The surface has been released");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
env->SetIntField(thiz, fields.surface_texture, (int)new_st.get());
|
env->SetIntField(thiz, fields.surface_texture, (int)new_st.get());
|
||||||
|
|||||||
Reference in New Issue
Block a user