From 611c950868da11cd035737c084e8a00af64d6ae1 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Mon, 4 Jul 2011 11:07:13 +0200 Subject: [PATCH] qtmux: mind requested name for request pad --- gst/isomp4/gstqtmux.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 2b867c765b..151b21f41b 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -3292,6 +3292,7 @@ gst_qt_mux_request_new_pad (GstElement * element, GstPad *newpad; gboolean audio; gchar *name; + gint pad_id; if (templ->direction != GST_PAD_SINK) 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")) { audio = TRUE; - name = g_strdup_printf ("audio_%02d", qtmux->audio_pads++); + 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++); + } } else if (templ == gst_element_class_get_pad_template (klass, "video_%d")) { audio = FALSE; - name = g_strdup_printf ("video_%02d", qtmux->video_pads++); + 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++); + } } else goto wrong_template;