Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4de6f81 authored by Jamie Gennis's avatar Jamie Gennis Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer: properly handle released surfaces" into ics-mr0

parents 63fae9d5 f76afc80
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -274,8 +274,14 @@ setVideoSurface(JNIEnv *env, jobject thiz, jobject jsurface, jboolean mediaPlaye
    sp<ISurfaceTexture> new_st;
    if (jsurface) {
        sp<Surface> surface(Surface_getSurface(env, jsurface));
        if (surface != NULL) {
            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());