summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-05-01 15:29:37 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-05-01 16:18:37 +0200
commit0d5dcba778d4bdb6c236961d93c35ff51049d638 (patch)
treeda2ea389b2340bcc96bc465c387db17b85153e4e
parentaea14053d1a979312e605543956e93a756f82b49 (diff)
downloadgstreamer-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
-rw-r--r--ext/hls/gsthlsdemux.c18
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)) {