diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-12-27 23:51:50 +0200 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-12-27 23:51:50 +0200 |
commit | 48111e3f18e3c7cf4d90ce4fccc8565d1f75f375 (patch) | |
tree | a2d84f0911793db69ea807ead2da16cfb828eb19 | |
parent | be0d7470cf3d59d4e46faa1bdeb9b0c2906e291e (diff) |
qtmux: use correct names from template for request pads
The pads where names pad0, pad1, ...
-rw-r--r-- | gst/qtmux/gstqtmux.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c index 6f787185c..1773092d8 100644 --- a/gst/qtmux/gstqtmux.c +++ b/gst/qtmux/gstqtmux.c @@ -275,2 +275,4 @@ gst_qt_mux_reset (GstQTMux * qtmux, gboolean alloc) qtmux->longest_chunk = GST_CLOCK_TIME_NONE; + qtmux->video_pads = 0; + qtmux->audio_pads = 0; @@ -2276,3 +2278,3 @@ static GstPad * gst_qt_mux_request_new_pad (GstElement * element, - GstPadTemplate * templ, const gchar * name) + GstPadTemplate * templ, const gchar * req_name) { @@ -2283,2 +2285,3 @@ gst_qt_mux_request_new_pad (GstElement * element, gboolean audio; + gchar *name; @@ -2290,8 +2293,8 @@ gst_qt_mux_request_new_pad (GstElement * element, - GST_DEBUG_OBJECT (qtmux, "Requested pad: %s", GST_STR_NULL (name)); - if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) { audio = TRUE; + 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++); } else @@ -2299,4 +2302,7 @@ gst_qt_mux_request_new_pad (GstElement * element, - /* add pad to collections */ + GST_DEBUG_OBJECT (qtmux, "Requested pad: %s", name); + + /* create pad and add to collections */ newpad = gst_pad_new_from_template (templ, name); + g_free (name); collect_pad = (GstQTPad *) |