From a818da90adeafd39e8865bcf3d126f3cf4fecf1b Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 29 Nov 2004 17:01:34 +0000 Subject: [PATCH] gst/playback/gststreaminfo.c: On mute of an unlinked stream, check for pad availability so we don't crash on unlinked... Original commit message from CVS: * gst/playback/gststreaminfo.c: (stream_info_mute_pad): On mute of an unlinked stream, check for pad availability so we don't crash on unlinked pad. --- ChangeLog | 6 ++++++ gst/playback/gststreaminfo.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3ec0f4..3372008 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2004-11-29 Ronald S. Bultje + * gst/playback/gststreaminfo.c: (stream_info_mute_pad): + On mute of an unlinked stream, check for pad availability so + we don't crash on unlinked pad. + +2004-11-29 Ronald S. Bultje + * gst/avi/gstavidemux.c: (gst_avi_demux_stream_index), (gst_avi_demux_massage_index): Fix quite humiliating bug in omitting 0-sized index chunks but diff --git a/gst/playback/gststreaminfo.c b/gst/playback/gststreaminfo.c index 62cdfcc..80362b1 100644 --- a/gst/playback/gststreaminfo.c +++ b/gst/playback/gststreaminfo.c @@ -212,18 +212,18 @@ stream_info_mute_pad (GstStreamInfo * stream_info, GstPad * pad, gboolean mute) int_links; int_links = g_list_next (int_links)) { GstPad *pad = GST_PAD (int_links->data); GstPad *peer = gst_pad_get_peer (pad); - GstElement *peer_elem = gst_pad_get_parent (peer); + GstElement *peer_elem = peer ? gst_pad_get_parent (peer) : NULL; GST_DEBUG_OBJECT (stream_info, "%s internal pad %s:%s", debug_str, GST_DEBUG_PAD_NAME (pad)); gst_pad_set_active (pad, activate); - if (peer_elem->numsrcpads == 1) { + if (peer_elem && peer_elem->numsrcpads == 1) { GST_DEBUG_OBJECT (stream_info, "recursing element %s on pad %s:%s", gst_element_get_name (peer_elem), GST_DEBUG_PAD_NAME (peer)); stream_info_mute_pad (stream_info, peer, mute); - } else { + } else if (peer) { GST_DEBUG_OBJECT (stream_info, "%s final pad %s:%s", debug_str, GST_DEBUG_PAD_NAME (peer)); gst_pad_set_active (peer, activate); -- 2.7.4