qtmux: mind requested name for request pad

This commit is contained in:
Mark Nauwelaerts 2011-07-04 11:07:13 +02:00
parent 1ea692bc63
commit 611c950868

View file

@ -3292,6 +3292,7 @@ gst_qt_mux_request_new_pad (GstElement * element,
GstPad *newpad; GstPad *newpad;
gboolean audio; gboolean audio;
gchar *name; gchar *name;
gint pad_id;
if (templ->direction != GST_PAD_SINK) if (templ->direction != GST_PAD_SINK)
goto wrong_direction; goto wrong_direction;
@ -3301,10 +3302,18 @@ gst_qt_mux_request_new_pad (GstElement * element,
if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) { if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) {
audio = TRUE; audio = TRUE;
if (req_name != NULL && sscanf (req_name, "audio_%02d", &pad_id) == 1) {
name = g_strdup (req_name);
} else {
name = g_strdup_printf ("audio_%02d", qtmux->audio_pads++); name = g_strdup_printf ("audio_%02d", qtmux->audio_pads++);
}
} else if (templ == gst_element_class_get_pad_template (klass, "video_%d")) { } else if (templ == gst_element_class_get_pad_template (klass, "video_%d")) {
audio = FALSE; audio = FALSE;
if (req_name != NULL && sscanf (req_name, "video_%02d", &pad_id) == 1) {
name = g_strdup (req_name);
} else {
name = g_strdup_printf ("video_%02d", qtmux->video_pads++); name = g_strdup_printf ("video_%02d", qtmux->video_pads++);
}
} else } else
goto wrong_template; goto wrong_template;