summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2013-01-27 15:00:36 +0100
committerMark Nauwelaerts <mnauw@users.sourceforge.net>2013-01-27 15:00:36 +0100
commit87e21e1c7a65f5347b84b7f77ae11e01dc64d0c2 (patch)
tree6e2021fcba94d61360248eb9d2054f2d96e888f1
parent25614380def9d1261c7300e5deec37117fa3b45d (diff)
qtdemux: push mode: only parse moov 1 once
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=691570 Conflicts: gst/isomp4/qtdemux.c
-rw-r--r--gst/isomp4/qtdemux.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c
index eb6954714..ea94cb25b 100644
--- a/gst/isomp4/qtdemux.c
+++ b/gst/isomp4/qtdemux.c
@@ -4224,25 +4224,32 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf)
extract_initial_length_and_fourcc (data, demux->neededbytes, NULL,
&fourcc);
if (fourcc == FOURCC_moov) {
- GST_DEBUG_OBJECT (demux, "Parsing [moov]");
+ /* in usual fragmented setup we could try to scan for more
+ * and end up at the the moov (after mdat) again */
+ if (demux->got_moov && demux->n_streams > 0) {
+ GST_DEBUG_OBJECT (demux,
+ "Skipping moov atom as we have one already");
+ } else {
+ GST_DEBUG_OBJECT (demux, "Parsing [moov]");
- demux->got_moov = TRUE;
+ demux->got_moov = TRUE;
- /* prepare newsegment to send when streaming actually starts */
- if (!demux->pending_newsegment) {
- demux->pending_newsegment =
- gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
- 0, GST_CLOCK_TIME_NONE, 0);
- }
+ /* prepare newsegment to send when streaming actually starts */
+ if (!demux->pending_newsegment) {
+ demux->pending_newsegment =
+ gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
+ 0, GST_CLOCK_TIME_NONE, 0);
+ }
- qtdemux_parse_moov (demux, data, demux->neededbytes);
- qtdemux_node_dump (demux, demux->moov_node);
- qtdemux_parse_tree (demux);
- qtdemux_expose_streams (demux);
+ qtdemux_parse_moov (demux, data, demux->neededbytes);
+ qtdemux_node_dump (demux, demux->moov_node);
+ qtdemux_parse_tree (demux);
+ qtdemux_expose_streams (demux);
- g_node_destroy (demux->moov_node);
- demux->moov_node = NULL;
- GST_DEBUG_OBJECT (demux, "Finished parsing the header");
+ g_node_destroy (demux->moov_node);
+ demux->moov_node = NULL;
+ GST_DEBUG_OBJECT (demux, "Finished parsing the header");
+ }
} else if (fourcc == FOURCC_moof) {
if (demux->got_moov && demux->fragmented) {
GST_DEBUG_OBJECT (demux, "Parsing [moof]");