From 6431de32860cc8b0e24f9973081e488fd50bdbff Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Wed, 21 Jan 2015 15:06:21 +0000 Subject: [PATCH] audiovisualizer: ensure default query/event handlers are used Sync audiovisualizer class implementation to the one in gst-plugins-base. This commit matches 9dd0e6cccc971d8a6bcca4e9e4d2ee1dbb20fffa in that module. https://bugzilla.gnome.org/show_bug.cgi?id=742875 --- gst/audiovisualizers/gstaudiovisualizer.c | 25 ++--------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/gst/audiovisualizers/gstaudiovisualizer.c b/gst/audiovisualizers/gstaudiovisualizer.c index ef49747739..0e9d52481c 100644 --- a/gst/audiovisualizers/gstaudiovisualizer.c +++ b/gst/audiovisualizers/gstaudiovisualizer.c @@ -81,8 +81,6 @@ static gboolean gst_audio_visualizer_sink_event (GstPad * pad, static gboolean gst_audio_visualizer_src_query (GstPad * pad, GstObject * parent, GstQuery * query); -static gboolean gst_audio_visualizer_sink_query (GstPad * pad, - GstObject * parent, GstQuery * query); static GstStateChangeReturn gst_audio_visualizer_change_state (GstElement * element, GstStateChange transition); @@ -586,8 +584,6 @@ gst_audio_visualizer_init (GstAudioVisualizer * scope, GST_DEBUG_FUNCPTR (gst_audio_visualizer_chain)); gst_pad_set_event_function (scope->sinkpad, GST_DEBUG_FUNCPTR (gst_audio_visualizer_sink_event)); - gst_pad_set_query_function (scope->sinkpad, - GST_DEBUG_FUNCPTR (gst_audio_visualizer_sink_query)); gst_element_add_pad (GST_ELEMENT (scope), scope->sinkpad); pad_template = @@ -1265,7 +1261,7 @@ gst_audio_visualizer_src_event (GstPad * pad, GstObject * parent, scope->earliest_time = timestamp + diff; GST_OBJECT_UNLOCK (scope); - res = gst_pad_push_event (scope->sinkpad, event); + res = gst_pad_event_default (pad, parent, event); break; } case GST_EVENT_RECONFIGURE: @@ -1300,9 +1296,6 @@ gst_audio_visualizer_sink_event (GstPad * pad, GstObject * parent, gst_event_unref (event); break; } - case GST_EVENT_FLUSH_START: - res = gst_pad_push_event (scope->srcpad, event); - break; case GST_EVENT_FLUSH_STOP: gst_audio_visualizer_reset (scope); res = gst_pad_push_event (scope->srcpad, event); @@ -1318,7 +1311,7 @@ gst_audio_visualizer_sink_event (GstPad * pad, GstObject * parent, break; } default: - res = gst_pad_push_event (scope->srcpad, event); + res = gst_pad_event_default (pad, parent, event); break; } @@ -1384,20 +1377,6 @@ gst_audio_visualizer_src_query (GstPad * pad, GstObject * parent, return res; } -static gboolean -gst_audio_visualizer_sink_query (GstPad * pad, GstObject * parent, - GstQuery * query) -{ - gboolean res = FALSE; - - switch (GST_QUERY_TYPE (query)) { - default: - res = gst_pad_query_default (pad, parent, query); - break; - } - return res; -} - static GstStateChangeReturn gst_audio_visualizer_change_state (GstElement * element, GstStateChange transition)