summaryrefslogtreecommitdiff
path: root/gst/mpegdemux/gstmpegdemux.c
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-10-11 15:29:36 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-10-12 17:03:38 +0200
commit61849aad61d0377afe3081534520d140544f7e46 (patch)
tree05d069da8a7ff6e0847206dda138c55ef797e45c /gst/mpegdemux/gstmpegdemux.c
parent44583eae90eb5b234fb145ad975209412e863ca4 (diff)
downloadgstreamer-plugins-bad-61849aad61d0377afe3081534520d140544f7e46.tar.gz
mpegdemux: do not add pad after no-more-pads
Diffstat (limited to 'gst/mpegdemux/gstmpegdemux.c')
-rw-r--r--gst/mpegdemux/gstmpegdemux.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index a9d47df63..78bbe05f9 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -305,7 +305,7 @@ gst_flups_demux_reset (GstFluPSDemux * demux)
GstFluPSStream *stream = demux->streams[i];
if (stream != NULL) {
- if (stream->pad)
+ if (stream->pad && GST_PAD_PARENT (stream->pad))
gst_element_remove_pad (GST_ELEMENT_CAST (demux), stream->pad);
g_free (stream);
@@ -487,7 +487,15 @@ gst_flups_demux_get_stream (GstFluPSDemux * demux, gint id, gint type)
GST_DEBUG_OBJECT (demux, "adding pad for stream id 0x%02x type 0x%02x", id,
type);
- gst_element_add_pad (GST_ELEMENT (demux), stream->pad);
+ if (demux->need_no_more_pads) {
+ gst_element_add_pad (GST_ELEMENT (demux), stream->pad);
+ } else {
+ /* only likely to confuse decodebin etc, so discard */
+ /* FIXME should perform full switch protocol:
+ * add a whole new set of pads, drop old and no-more-pads again */
+ GST_DEBUG_OBJECT (demux,
+ "but already signalled no-more-pads; not adding");
+ }
demux->streams[id] = stream;
demux->streams_found[demux->found_count++] = stream;