summaryrefslogtreecommitdiffstats
path: root/gst/qtdemux
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2009-03-20 17:11:39 +0100
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2009-03-20 17:59:35 +0100
commitd5120cda4b45c9ea17266e2d4c943df603730af7 (patch)
tree62893e31049d4e1efee558794df73ce7a7327864 /gst/qtdemux
parent21fc435c714f9dd650508d3ab466cb38d2ead2c4 (diff)
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.
Diffstat (limited to 'gst/qtdemux')
-rw-r--r--gst/qtdemux/qtdemux.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 3f22cb95..d1ddef5a 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)