summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2014-08-19 00:01:28 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2014-08-19 00:02:33 -0300
commit52257fe538cf33d2f10855d5ca3a8c3570cc382e (patch)
tree57482c3b648b239cbf6549c01ea96a975b84fc84
parente93551d5b0e08eac5fd9ad899bf814cb8d349bd6 (diff)
tsdemux: remove pads when resetting the element
Otherwise the pads will be there if it is restarted and the stream can be a completely different one. https://bugzilla.gnome.org/show_bug.cgi?id=734394
-rw-r--r--gst/mpegtsdemux/tsdemux.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c
index 3cb63c0b2..4cd051c90 100644
--- a/gst/mpegtsdemux/tsdemux.c
+++ b/gst/mpegtsdemux/tsdemux.c
@@ -1431,15 +1431,19 @@ gst_ts_demux_stream_removed (MpegTSBase * base, MpegTSBaseStream * bstream)
if (stream->pad) {
gst_flow_combiner_remove_pad (GST_TS_DEMUX_CAST (base)->flowcombiner,
stream->pad);
- if (stream->active && gst_pad_is_active (stream->pad)) {
- /* Flush out all data */
- GST_DEBUG_OBJECT (stream->pad, "Flushing out pending data");
- gst_ts_demux_push_pending_data ((GstTSDemux *) base, stream);
-
- GST_DEBUG_OBJECT (stream->pad, "Pushing out EOS");
- gst_pad_push_event (stream->pad, gst_event_new_eos ());
- GST_DEBUG_OBJECT (stream->pad, "Deactivating and removing pad");
- gst_pad_set_active (stream->pad, FALSE);
+ if (stream->active) {
+
+ if (gst_pad_is_active (stream->pad)) {
+ /* Flush out all data */
+ GST_DEBUG_OBJECT (stream->pad, "Flushing out pending data");
+ gst_ts_demux_push_pending_data ((GstTSDemux *) base, stream);
+
+ GST_DEBUG_OBJECT (stream->pad, "Pushing out EOS");
+ gst_pad_push_event (stream->pad, gst_event_new_eos ());
+ gst_pad_set_active (stream->pad, FALSE);
+ }
+
+ GST_DEBUG_OBJECT (stream->pad, "Removing pad");
gst_element_remove_pad (GST_ELEMENT_CAST (base), stream->pad);
stream->active = FALSE;
}