diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-05-01 15:29:37 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-05-01 16:18:37 +0200 |
commit | 0d5dcba778d4bdb6c236961d93c35ff51049d638 (patch) | |
tree | da2ea389b2340bcc96bc465c387db17b85153e4e /ext/hls/gsthlsdemux.c | |
parent | aea14053d1a979312e605543956e93a756f82b49 (diff) | |
download | gstreamer-plugins-bad-0d5dcba778d4bdb6c236961d93c35ff51049d638.tar.gz |
hlsdemux: Only set PTS on the first buffer of a fragment instead of setting the same on all of them
Diffstat (limited to 'ext/hls/gsthlsdemux.c')
-rw-r--r-- | ext/hls/gsthlsdemux.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index bbd6bdd76..ed23d11a9 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -845,24 +845,26 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) buffer = tmp_buffer; } + if (!buffer) { + return GST_FLOW_OK; + } + if (demux->starting_fragment) { + GST_LOG_OBJECT (demux, "set buffer pts=%" GST_TIME_FORMAT, + GST_TIME_ARGS (demux->current_timestamp)); + GST_BUFFER_PTS (buffer) = demux->current_timestamp; + if (demux->segment.rate < 0) /* Set DISCONT flag for every first buffer in reverse playback mode * as each fragment for its own has to be reversed */ demux->discont = TRUE; demux->starting_fragment = FALSE; + } else { + GST_BUFFER_PTS (buffer) = GST_CLOCK_TIME_NONE; } - if (!buffer) { - return GST_FLOW_OK; - } - - GST_LOG_OBJECT (demux, "set buffer pts=%" GST_TIME_FORMAT, - GST_TIME_ARGS (demux->current_timestamp)); - GST_BUFFER_DURATION (buffer) = GST_CLOCK_TIME_NONE; GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE; - GST_BUFFER_PTS (buffer) = demux->current_timestamp; /* We actually need to do this every time we switch bitrate */ if (G_UNLIKELY (demux->do_typefind)) { |