wildmidi: fix event and query handler

Call the default implementation for unknown events and queries.
Fix event leak.
This commit is contained in:
Wim Taymans 2013-03-19 13:54:00 +01:00
parent d2d6798087
commit 66d0d86e78

View file

@ -393,7 +393,7 @@ gst_wildmidi_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
TRUE, 0, wildmidi->o_len); TRUE, 0, wildmidi->o_len);
break; break;
default: default:
res = FALSE; res = gst_pad_query_default (pad, parent, query);
break; break;
} }
@ -539,6 +539,7 @@ gst_wildmidi_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
default: default:
break; break;
} }
gst_event_unref (event);
return res; return res;
} }
@ -789,7 +790,7 @@ eos:
static gboolean static gboolean
gst_wildmidi_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) gst_wildmidi_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{ {
gboolean res = FALSE; gboolean res;
GstWildmidi *wildmidi = GST_WILDMIDI (parent); GstWildmidi *wildmidi = GST_WILDMIDI (parent);
GST_DEBUG_OBJECT (pad, "%s event received", GST_EVENT_TYPE_NAME (event)); GST_DEBUG_OBJECT (pad, "%s event received", GST_EVENT_TYPE_NAME (event));
@ -798,16 +799,15 @@ gst_wildmidi_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
case GST_EVENT_EOS: case GST_EVENT_EOS:
wildmidi->state = GST_WILDMIDI_STATE_PARSE; wildmidi->state = GST_WILDMIDI_STATE_PARSE;
/* now start the parsing task */ /* now start the parsing task */
gst_pad_start_task (wildmidi->sinkpad, res = gst_pad_start_task (wildmidi->sinkpad,
(GstTaskFunction) gst_wildmidi_loop, wildmidi->sinkpad, NULL); (GstTaskFunction) gst_wildmidi_loop, wildmidi->sinkpad, NULL);
/* don't forward the event */ /* don't forward the event */
gst_event_unref (event); gst_event_unref (event);
break; break;
default: default:
res = gst_pad_push_event (wildmidi->srcpad, event); res = gst_pad_event_default (pad, parent, event);
break; break;
} }
return res; return res;
} }