audiodecoder: Fix leak on failed audio gaps

If we fail to process the gap event we need to unref the event or
we end up with a leak.
This commit is contained in:
Doug Nazar 2019-06-26 03:39:54 -04:00
parent ff0f659ca5
commit fb842a3fdb

View file

@ -2225,6 +2225,7 @@ gst_audio_decoder_handle_gap (GstAudioDecoder * dec, GstEvent * event)
GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
GST_ELEMENT_ERROR (dec, STREAM, FORMAT, (NULL),
("Decoder output not negotiated before GAP event."));
gst_event_unref (event);
return FALSE;
}
needs_reconfigure = TRUE;
@ -2273,6 +2274,7 @@ gst_audio_decoder_handle_gap (GstAudioDecoder * dec, GstEvent * event)
ret = gst_audio_decoder_push_event (dec, event);
} else {
ret = FALSE;
gst_event_unref (event);
}
}
return ret;