From 5ad2dc58df08b5871fe67e300983858bfccd79f4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 26 May 2008 09:57:40 +0000 Subject: Don't use _gst_pad(). Original commit message from CVS: * examples/switch/switcher.c: (switch_timer): * gst/replaygain/gstrgvolume.c: (gst_rg_volume_init): * gst/rtpmanager/gstrtpclient.c: (create_stream): * gst/sdp/gstsdpdemux.c: (gst_sdp_demux_stream_configure_udp), (gst_sdp_demux_stream_configure_udp_sink): * tests/check/elements/deinterleave.c: (GST_START_TEST), (pad_added_setup_data_check_float32_8ch_cb): * tests/check/elements/rganalysis.c: (send_eos_event), (send_tag_event): Don't use _gst_pad(). --- examples/switch/switcher.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/switch/switcher.c b/examples/switch/switcher.c index 2e274a7b8..4742c0337 100644 --- a/examples/switch/switcher.c +++ b/examples/switch/switcher.c @@ -68,20 +68,23 @@ static gboolean switch_timer (GstElement * video_switch) { gint nb_sources; - GstPad *active_pad; + GstPad *active_pad, *new_pad; + gchar *active_name; g_message ("switching"); g_object_get (G_OBJECT (video_switch), "n-pads", &nb_sources, NULL); g_object_get (G_OBJECT (video_switch), "active-pad", &active_pad, NULL); - if (strcmp (gst_pad_get_name (active_pad), "sink0") == 0) { - - g_object_set (G_OBJECT (video_switch), "active-pad", - gst_element_get_pad (video_switch, "sink1"), NULL); + active_name = gst_pad_get_name (active_pad); + if (strcmp (active_name, "sink0") == 0) { + new_pad = gst_element_get_static_pad (video_switch, "sink1"); } else { - g_object_set (G_OBJECT (video_switch), "active-pad", - gst_element_get_pad (video_switch, "sink0"), NULL); + new_pad = gst_element_get_static_pad (video_switch, "sink0"); } + g_object_set (G_OBJECT (video_switch), "active-pad", new_pad, NULL); + g_free (active_name); + gst_object_unref (new_pad); + g_message ("current number of sources : %d, active source %s", nb_sources, gst_pad_get_name (active_pad)); -- cgit v1.2.3