Merge "If media player has died already, do not dec the old surface texture reference. Otherwise segfault will occur. For bug 5327664."
This commit is contained in:
@ -247,6 +247,11 @@ getVideoSurfaceTexture(JNIEnv* env, jobject thiz) {
|
|||||||
static void
|
static void
|
||||||
decVideoSurfaceRef(JNIEnv *env, jobject thiz)
|
decVideoSurfaceRef(JNIEnv *env, jobject thiz)
|
||||||
{
|
{
|
||||||
|
sp<MediaPlayer> mp = getMediaPlayer(env, thiz);
|
||||||
|
if (mp == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sp<ISurfaceTexture> old_st = getVideoSurfaceTexture(env, thiz);
|
sp<ISurfaceTexture> old_st = getVideoSurfaceTexture(env, thiz);
|
||||||
if (old_st != NULL) {
|
if (old_st != NULL) {
|
||||||
old_st->decStrong(thiz);
|
old_st->decStrong(thiz);
|
||||||
|
Reference in New Issue
Block a user