Merge "If media player has died already, do not dec the old surface texture reference. Otherwise segfault will occur. For bug 5327664. Do not merge." into ics-factoryrom

This commit is contained in:
Gloria Wang
2011-09-15 17:04:27 -07:00
committed by Android (Google) Code Review

View File

@ -247,6 +247,11 @@ getVideoSurfaceTexture(JNIEnv* env, jobject thiz) {
static void
decVideoSurfaceRef(JNIEnv *env, jobject thiz)
{
sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
if (mp == NULL) {
return;
}
sp<ISurfaceTexture> old_st = getVideoSurfaceTexture(env, thiz);
if (old_st != NULL) {
old_st->decStrong(thiz);