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
This commit is contained in:
Jorge Zapata 2014-05-30 12:40:08 +02:00 committed by Andoni Morales Alastruey
parent 0ae4bc74ba
commit ad82575693
2 changed files with 6 additions and 2 deletions

View file

@ -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;

View file

@ -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;