diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2008-05-26 09:57:40 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-05-26 09:57:40 +0000 |
commit | 5ad2dc58df08b5871fe67e300983858bfccd79f4 (patch) | |
tree | 93753100eeaa9151373ef1c4a2990c9ed8dde145 /examples | |
parent | b7c64b81655f4cd7ba4e55fc0a4d69e5c9b3fd4b (diff) |
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().
Diffstat (limited to 'examples')
-rw-r--r-- | examples/switch/switcher.c | 17 |
1 files changed, 10 insertions, 7 deletions
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)); |