qtmux: fix reusing element
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Wed, 25 Mar 2009 20:24:44 +0000 (21:24 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 12 Apr 2011 19:32:11 +0000 (20:32 +0100)
State change to READY and then back to PAUSED should still provide
the proper structures as are otherwise freshly available following
a request_new_pad.

Pointed out by Thiago Santos.

gst/quicktime/gstqtmux.c

index 4b4344b..f3e85f5 100644 (file)
@@ -293,6 +293,13 @@ gst_qt_mux_reset (GstQTMux * qtmux, gboolean alloc)
 
   if (alloc) {
     qtmux->moov = atom_moov_new (qtmux->context);
+    /* ensure all is as nice and fresh as request_new_pad would provide it */
+    for (walk = qtmux->collect->data; walk; walk = g_slist_next (walk)) {
+      GstQTPad *qtpad = (GstQTPad *) walk->data;
+
+      qtpad->trak = atom_trak_new (qtmux->context);
+      atom_moov_add_trak (qtmux->moov, qtpad->trak);
+    }
   }
 }