summaryrefslogtreecommitdiff
authorStefan Kost <ensonic@users.sf.net>2009-12-27 21:51:50 (GMT)
committer Stefan Kost <ensonic@users.sf.net>2009-12-27 21:51:50 (GMT)
commit48111e3f18e3c7cf4d90ce4fccc8565d1f75f375 (patch) (side-by-side diff)
treea2d84f0911793db69ea807ead2da16cfb828eb19
parentbe0d7470cf3d59d4e46faa1bdeb9b0c2906e291e (diff)
downloadgst-plugins-bad-48111e3f18e3c7cf4d90ce4fccc8565d1f75f375.zip
gst-plugins-bad-48111e3f18e3c7cf4d90ce4fccc8565d1f75f375.tar.gz
qtmux: use correct names from template for request pads
The pads where names pad0, pad1, ...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--gst/qtmux/gstqtmux.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c
index 6f78718..1773092 100644
--- a/gst/qtmux/gstqtmux.c
+++ b/gst/qtmux/gstqtmux.c
@@ -273,6 +273,8 @@ gst_qt_mux_reset (GstQTMux * qtmux, gboolean alloc)
qtmux->mdat_size = 0;
qtmux->mdat_pos = 0;
qtmux->longest_chunk = GST_CLOCK_TIME_NONE;
+ qtmux->video_pads = 0;
+ qtmux->audio_pads = 0;
if (qtmux->ftyp) {
atom_ftyp_free (qtmux->ftyp);
@@ -2274,13 +2276,14 @@ gst_qt_mux_release_pad (GstElement * element, GstPad * pad)
static GstPad *
gst_qt_mux_request_new_pad (GstElement * element,
- GstPadTemplate * templ, const gchar * name)
+ GstPadTemplate * templ, const gchar * req_name)
{
GstElementClass *klass = GST_ELEMENT_GET_CLASS (element);
GstQTMux *qtmux = GST_QT_MUX_CAST (element);
GstQTPad *collect_pad;
GstPad *newpad;
gboolean audio;
+ gchar *name;
if (templ->direction != GST_PAD_SINK)
goto wrong_direction;
@@ -2288,17 +2291,20 @@ gst_qt_mux_request_new_pad (GstElement * element,
if (qtmux->state != GST_QT_MUX_STATE_NONE)
goto too_late;
- 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
goto wrong_template;
- /* 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 *)
gst_collect_pads_add_pad_full (qtmux->collect, newpad, sizeof (GstQTPad),
(GstCollectDataDestroyNotify) (gst_qt_mux_pad_reset));