mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 21:51:09 +00:00
Use more performant link function
We can use gst_element_link_pads() instead of the more generic gst_element_link() function because we know the pads. This saves some cycles because the more generic function needs to search for possible compatible caps etc.
This commit is contained in:
parent
a7f2540f77
commit
8dd3c2d543
1 changed files with 2 additions and 2 deletions
|
@ -1160,12 +1160,12 @@ type_found (GstElement * typefind, guint probability,
|
||||||
|
|
||||||
gst_bin_add (GST_BIN_CAST (decoder), queue);
|
gst_bin_add (GST_BIN_CAST (decoder), queue);
|
||||||
|
|
||||||
if (!gst_element_link (typefind, queue))
|
if (!gst_element_link_pads (typefind, "src", queue, "sink"))
|
||||||
goto could_not_link;
|
goto could_not_link;
|
||||||
|
|
||||||
g_object_set (G_OBJECT (dec_elem), "sink-caps", caps, NULL);
|
g_object_set (G_OBJECT (dec_elem), "sink-caps", caps, NULL);
|
||||||
|
|
||||||
if (!gst_element_link (queue, dec_elem))
|
if (!gst_element_link_pads (queue, "src", dec_elem, "sink"))
|
||||||
goto could_not_link;
|
goto could_not_link;
|
||||||
|
|
||||||
gst_element_set_state (dec_elem, GST_STATE_PLAYING);
|
gst_element_set_state (dec_elem, GST_STATE_PLAYING);
|
||||||
|
|
Loading…
Reference in a new issue