mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
videomixer: Make selection of a sinkpad number threadsafe
This commit is contained in:
parent
9d6e4a7ac8
commit
85c6b9b712
1 changed files with 3 additions and 2 deletions
|
@ -1101,7 +1101,9 @@ gst_videomixer_request_new_pad (GstElement * element,
|
||||||
gchar *name = NULL;
|
gchar *name = NULL;
|
||||||
GstVideoMixerCollect *mixcol = NULL;
|
GstVideoMixerCollect *mixcol = NULL;
|
||||||
|
|
||||||
if (req_name == NULL || strlen (req_name) < 6) {
|
GST_VIDEO_MIXER_STATE_LOCK (mix);
|
||||||
|
if (req_name == NULL || strlen (req_name) < 6
|
||||||
|
|| !g_str_has_prefix (req_name, "sink_")) {
|
||||||
/* no name given when requesting the pad, use next available int */
|
/* no name given when requesting the pad, use next available int */
|
||||||
serial = mix->next_sinkpad++;
|
serial = mix->next_sinkpad++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1116,7 +1118,6 @@ gst_videomixer_request_new_pad (GstElement * element,
|
||||||
templ->direction, "template", templ, NULL);
|
templ->direction, "template", templ, NULL);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
|
|
||||||
GST_VIDEO_MIXER_STATE_LOCK (mix);
|
|
||||||
mixpad->zorder = mix->numpads;
|
mixpad->zorder = mix->numpads;
|
||||||
mixpad->xpos = DEFAULT_PAD_XPOS;
|
mixpad->xpos = DEFAULT_PAD_XPOS;
|
||||||
mixpad->ypos = DEFAULT_PAD_YPOS;
|
mixpad->ypos = DEFAULT_PAD_YPOS;
|
||||||
|
|
Loading…
Reference in a new issue