tee: Check if parsing the name template with sscanf() was successful

If not, go back to the automatic pad numbering.

CID 1195129
This commit is contained in:
Sebastian Dröge 2015-12-14 13:06:57 +01:00
parent 33ded76ab8
commit 7e761798bd

View file

@ -361,8 +361,7 @@ gst_tee_request_new_pad (GstElement * element, GstPadTemplate * templ,
GST_OBJECT_LOCK (tee); GST_OBJECT_LOCK (tee);
if (name_templ) { if (name_templ && sscanf (name_templ, "src_%u", &index) == 1) {
sscanf (name_templ, "src_%u", &index);
GST_LOG_OBJECT (element, "name: %s (index %d)", name_templ, index); GST_LOG_OBJECT (element, "name: %s (index %d)", name_templ, index);
if (g_hash_table_contains (tee->pad_indexes, GUINT_TO_POINTER (index))) { if (g_hash_table_contains (tee->pad_indexes, GUINT_TO_POINTER (index))) {
GST_ERROR_OBJECT (element, "pad name %s is not unique", name_templ); GST_ERROR_OBJECT (element, "pad name %s is not unique", name_templ);