From d5120cda4b45c9ea17266e2d4c943df603730af7 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 20 Mar 2009 17:11:39 +0100 Subject: [PATCH] qtdemux: align push based behaviour more with pull based Cater for DELTA_UNIT flag on buffers, keep track of current position, remove and warn about edit lists if any (as those as are de facto discarded anyway), add some debug statements and indent fixes. --- gst/qtdemux/qtdemux.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 3f22cb95c2..d1ddef5a08 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -2248,6 +2248,7 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf) demux->offset); if (demux->todrop) { + GST_LOG_OBJECT (demux, "Dropping %d bytes", demux->todrop); gst_adapter_flush (demux->adapter, demux->todrop); demux->neededbytes -= demux->todrop; demux->offset += demux->todrop; @@ -2296,6 +2297,13 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf) } GST_BUFFER_DURATION (outbuf) = stream->samples[stream->sample_index].duration; + if (!stream->all_keyframe && + !stream->samples[stream->sample_index].keyframe) + GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DELTA_UNIT); + + /* position reporting */ + gst_segment_set_last_stop (&demux->segment, GST_FORMAT_TIME, + demux->last_ts); /* send buffer */ if (stream->pad) { @@ -3318,6 +3326,16 @@ qtdemux_parse_segments (GstQTDemux * qtdemux, QtDemuxStream * stream, } done: + /* push based does not handle segments, so act accordingly here, + * and warn if applicable */ + if (!qtdemux->pullbased) { + GST_WARNING_OBJECT (qtdemux, "streaming; discarding edit list segments"); + /* remove and use default one below, we stream like it anyway */ + g_free (stream->segments); + stream->segments = NULL; + stream->n_segments = 0; + } + /* no segments, create one to play the complete trak */ if (stream->n_segments == 0) { if (stream->segments == NULL)