From 3a38311f01f3ce62139a7979627152788dba3cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 9 Oct 2006 12:09:14 +0000 Subject: [PATCH] gst/: Active pads before adding them to the running element. Don't assert on non-BYTE format newsegment events in asf... Original commit message from CVS: * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_sink_event), (gst_asf_demux_setup_pad), (gst_asf_demux_process_segment): * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_get_audio_stream), (gst_dvd_demux_get_subpicture_stream): * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_get_video_stream), (gst_mpeg_demux_get_audio_stream), (gst_mpeg_demux_get_private_stream): Active pads before adding them to the running element. Don't assert on non-BYTE format newsegment events in asfdemux. --- ChangeLog | 12 ++++++++++++ common | 2 +- gst/asfdemux/gstasfdemux.c | 10 ++++++++-- gst/mpegstream/gstdvddemux.c | 2 ++ gst/mpegstream/gstmpegdemux.c | 5 +++++ 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d1084b6aa..20b1031bbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2006-10-09 Tim-Philipp Müller + + * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_sink_event), + (gst_asf_demux_setup_pad), (gst_asf_demux_process_segment): + * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_get_audio_stream), + (gst_dvd_demux_get_subpicture_stream): + * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_get_video_stream), + (gst_mpeg_demux_get_audio_stream), + (gst_mpeg_demux_get_private_stream): + Active pads before adding them to the running element. Don't assert + on non-BYTE format newsegment events in asfdemux. + 2006-10-05 Tim-Philipp Müller * ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_goto_title), diff --git a/common b/common index a4af1b8542..efcacf2625 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit a4af1b8542911352e29d53fba47e2c3d7231ebdb +Subproject commit efcacf2625da231fbee99b68e0f5db6816cf6fad diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 27a47a7a6d..31b6847921 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -152,7 +152,12 @@ gst_asf_demux_sink_event (GstPad * pad, GstEvent * event) gst_event_parse_new_segment (event, NULL, NULL, &newsegment_format, &newsegment_start, NULL, NULL); - g_assert (newsegment_format == GST_FORMAT_BYTES); + if (newsegment_format != GST_FORMAT_BYTES) { + GST_WARNING_OBJECT (demux, "newsegment format not BYTES, ignoring"); + gst_event_unref (event); + break; + } + g_assert (newsegment_start >= 0); GST_OBJECT_LOCK (demux); @@ -869,6 +874,7 @@ gst_asf_demux_setup_pad (GstASFDemux * demux, GstPad * src_pad, ++demux->num_streams; + gst_pad_set_active (src_pad, TRUE); gst_element_add_pad (GST_ELEMENT (demux), src_pad); } @@ -2387,7 +2393,7 @@ gst_asf_demux_process_segment (GstASFDemux * demux, time_start = segment_info.frag_offset; segment_info.frag_offset = 0; - segment_info.frag_timestamp = time_start; + segment_info.frag_timestamp = time_start; /* was: demux->timestamp */ } GST_DEBUG ("multiple = %u, compressed = %u", diff --git a/gst/mpegstream/gstdvddemux.c b/gst/mpegstream/gstdvddemux.c index ed8d98853d..9bc4acc60c 100644 --- a/gst/mpegstream/gstdvddemux.c +++ b/gst/mpegstream/gstdvddemux.c @@ -654,6 +654,7 @@ gst_dvd_demux_get_audio_stream (GstMPEGDemux * mpeg_demux, GST_DEBUG_OBJECT (mpeg_demux, "adding pad %s with language = %s", GST_PAD_NAME (str->pad), (lang_code) ? lang_code : "(unknown)"); + gst_pad_set_active (str->pad, TRUE); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); if (codec || lang_code) { @@ -735,6 +736,7 @@ gst_dvd_demux_get_subpicture_stream (GstMPEGDemux * mpeg_demux, } if (add_pad) { + gst_pad_set_active (str->pad, TRUE); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); if (dvd_demux->langcodes) { diff --git a/gst/mpegstream/gstmpegdemux.c b/gst/mpegstream/gstmpegdemux.c index 37f6651c87..2abba38851 100644 --- a/gst/mpegstream/gstmpegdemux.c +++ b/gst/mpegstream/gstmpegdemux.c @@ -341,9 +341,11 @@ gst_mpeg_demux_get_video_stream (GstMPEGDemux * mpeg_demux, CORE, NEGOTIATION, (NULL), ("failed to set caps")); gst_caps_unref (str->caps); str->caps = NULL; + gst_pad_set_active (str->pad, TRUE); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); return str; } + gst_pad_set_active (str->pad, TRUE); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); /* Store the current values. */ @@ -409,9 +411,11 @@ gst_mpeg_demux_get_audio_stream (GstMPEGDemux * mpeg_demux, CORE, NEGOTIATION, (NULL), ("failed to set caps")); gst_caps_unref (str->caps); str->caps = NULL; + gst_pad_set_active (str->pad, TRUE); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); return str; } + gst_pad_set_active (str->pad, TRUE); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); /* stream metadata */ @@ -441,6 +445,7 @@ gst_mpeg_demux_get_private_stream (GstMPEGDemux * mpeg_demux, CLASS (mpeg_demux)->init_stream (mpeg_demux, type, str, stream_nr, name, CLASS (mpeg_demux)->private_template); g_free (name); + gst_pad_set_active (str->pad, TRUE); gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); mpeg_demux->private_stream[stream_nr] = str;