mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
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.
This commit is contained in:
parent
21fc435c71
commit
d5120cda4b
1 changed files with 18 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue