From ad82575693fdccb912b5368f4170ed4188f9acb2 Mon Sep 17 00:00:00 2001 From: Jorge Zapata Date: Fri, 30 May 2014 12:40:08 +0200 Subject: [PATCH] Release the codec before freeing it On Samsung Galaxy S4 it is impossible to have more than one hardware decoder at the same time. If we do not release it explicitly the GC only releases it whenever the whole application is finished not whenever the activity is finished and thus a player will not be able to work correctly --- sys/androidmedia/gstamcaudiodec.c | 4 +++- sys/androidmedia/gstamcvideodec.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c index 30751e1..cacbbba 100644 --- a/sys/androidmedia/gstamcaudiodec.c +++ b/sys/androidmedia/gstamcaudiodec.c @@ -246,8 +246,10 @@ gst_amc_audio_dec_close (GstAudioDecoder * decoder) GST_DEBUG_OBJECT (self, "Closing decoder"); - if (self->codec) + if (self->codec) { + gst_amc_codec_release (self->codec); gst_amc_codec_free (self->codec); + } self->codec = NULL; self->started = FALSE; diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c index 08370ab..81f4b94 100644 --- a/sys/androidmedia/gstamcvideodec.c +++ b/sys/androidmedia/gstamcvideodec.c @@ -270,8 +270,10 @@ gst_amc_video_dec_close (GstVideoDecoder * decoder) GST_DEBUG_OBJECT (self, "Closing decoder"); - if (self->codec) + if (self->codec) { + gst_amc_codec_release (self->codec); gst_amc_codec_free (self->codec); + } self->codec = NULL; self->started = FALSE; -- 2.7.4