diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-27 11:20:02 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-03-27 11:21:21 +0100 |
commit | 960515083060eb2cb6bc959b5aff3e493e3486be (patch) | |
tree | 42fb6efc5306a2c5cdc33025d42b1aea09a1e65e /gst/selector | |
parent | 654ca28f1b23fbba22b121b56bc5df9db8d588dc (diff) | |
download | gst-plugins-bad-960515083060eb2cb6bc959b5aff3e493e3486be.tar.gz gst-plugins-bad-960515083060eb2cb6bc959b5aff3e493e3486be.tar.bz2 gst-plugins-bad-960515083060eb2cb6bc959b5aff3e493e3486be.zip |
outputselector: reset state when going to READY
Reset the last-buffer, the pending pad and the segment when going to the READY
state.
Fixes #576712.
Diffstat (limited to 'gst/selector')
-rw-r--r-- | gst/selector/gstoutputselector.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/gst/selector/gstoutputselector.c b/gst/selector/gstoutputselector.c index 74191cb0..32988af4 100644 --- a/gst/selector/gstoutputselector.c +++ b/gst/selector/gstoutputselector.c @@ -158,10 +158,8 @@ gst_output_selector_init (GstOutputSelector * sel, } static void -gst_output_selector_dispose (GObject * object) +gst_output_selector_reset (GstOutputSelector * osel) { - GstOutputSelector *osel = GST_OUTPUT_SELECTOR (object); - if (osel->pending_srcpad != NULL) { gst_object_unref (osel->pending_srcpad); osel->pending_srcpad = NULL; @@ -170,6 +168,15 @@ gst_output_selector_dispose (GObject * object) gst_buffer_unref (osel->latest_buffer); osel->latest_buffer = NULL; } + gst_segment_init (&osel->segment, GST_FORMAT_UNDEFINED); +} + +static void +gst_output_selector_dispose (GObject * object) +{ + GstOutputSelector *osel = GST_OUTPUT_SELECTOR (object); + + gst_output_selector_reset (osel); G_OBJECT_CLASS (parent_class)->dispose (object); } @@ -379,7 +386,29 @@ static GstStateChangeReturn gst_output_selector_change_state (GstElement * element, GstStateChange transition) { - return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + GstOutputSelector *sel; + GstStateChangeReturn result; + + sel = GST_OUTPUT_SELECTOR (element); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: + break; + default: + break; + } + + result = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + + switch (transition) { + case GST_STATE_CHANGE_PAUSED_TO_READY: + gst_output_selector_reset (sel); + break; + default: + break; + } + + return result; } static gboolean @@ -412,7 +441,6 @@ gst_output_selector_handle_sink_event (GstPad * pad, GstEvent * event) /* Send newsegment to all src pads */ gst_pad_event_default (pad, event); - break; } case GST_EVENT_EOS: |