mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 14:38:48 +00:00
audioparsers: baseparse: Be careful to not lose the event ref
Don't unref the event if it hasn't been handled, because the caller assumes it is still valid and might reuse it. I ran into this problem when transcoding an AVI (with mp3 inside) to gpp. https://bugzilla.gnome.org/show_bug.cgi?id=639555
This commit is contained in:
parent
f59a1d2868
commit
a6a982e8be
1 changed files with 7 additions and 2 deletions
|
@ -738,7 +738,10 @@ gst_base_parse_sink_event (GstPad * pad, GstEvent * event)
|
||||||
*
|
*
|
||||||
* Element-level event handler function.
|
* Element-level event handler function.
|
||||||
*
|
*
|
||||||
* Returns: TRUE if the event was handled and not need forwarding.
|
* The event will be unreffed only if it has been handled and this
|
||||||
|
* function returns %TRUE
|
||||||
|
*
|
||||||
|
* Returns: %TRUE if the event was handled and not need forwarding.
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_base_parse_sink_eventfunc (GstBaseParse * parse, GstEvent * event)
|
gst_base_parse_sink_eventfunc (GstBaseParse * parse, GstEvent * event)
|
||||||
|
@ -858,7 +861,9 @@ gst_base_parse_sink_eventfunc (GstBaseParse * parse, GstEvent * event)
|
||||||
|
|
||||||
case GST_EVENT_FLUSH_START:
|
case GST_EVENT_FLUSH_START:
|
||||||
parse->priv->flushing = TRUE;
|
parse->priv->flushing = TRUE;
|
||||||
handled = gst_pad_push_event (parse->srcpad, event);
|
handled = gst_pad_push_event (parse->srcpad, gst_event_ref (event));
|
||||||
|
if (handled)
|
||||||
|
gst_event_unref (event);
|
||||||
/* Wait for _chain() to exit by taking the srcpad STREAM_LOCK */
|
/* Wait for _chain() to exit by taking the srcpad STREAM_LOCK */
|
||||||
GST_PAD_STREAM_LOCK (parse->srcpad);
|
GST_PAD_STREAM_LOCK (parse->srcpad);
|
||||||
GST_PAD_STREAM_UNLOCK (parse->srcpad);
|
GST_PAD_STREAM_UNLOCK (parse->srcpad);
|
||||||
|
|
Loading…
Reference in a new issue