qtdemux: Do allocation query after exposing all pads and no-more-pads
authorSebastian Dröge <slomo@circular-chaos.org>
Tue, 11 Jun 2013 10:26:24 +0000 (12:26 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Tue, 11 Jun 2013 10:27:19 +0000 (12:27 +0200)
Also configure video streams as early as possible.

Related https://bugzilla.gnome.org/show_bug.cgi?id=701856
but not fixing that.

gst/isomp4/qtdemux.c

index f9a92eb..7fbe5f8 100644 (file)
@@ -5672,6 +5672,7 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux,
     stream->pad =
         gst_pad_new_from_static_template (&gst_qtdemux_videosrc_template, name);
     g_free (name);
+    gst_qtdemux_configure_stream (qtdemux, stream);
     qtdemux->n_video_streams++;
   } else {
     GST_DEBUG_OBJECT (qtdemux, "unknown stream type");
@@ -5688,8 +5689,6 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux,
     stream->pending_tags = list;
     /* global tags go on each pad anyway */
     stream->send_global_tags = TRUE;
-
-    qtdemux_do_allocation (qtdemux, stream);
   }
 done:
   return TRUE;
@@ -8345,6 +8344,12 @@ qtdemux_expose_streams (GstQTDemux * qtdemux)
     qtdemux->posted_redirect = TRUE;
   }
 
+  for (i = 0; i < qtdemux->n_streams; i++) {
+    QtDemuxStream *stream = qtdemux->streams[i];
+
+    qtdemux_do_allocation (qtdemux, stream);
+  }
+
   qtdemux->exposed = TRUE;
   return ret;
 }