hlsdemux: Add condition for setting stream discontinuity 11/266611/2 accepted/tizen/6.0/unified/20211117.211704 submit/tizen_6.0/20211117.042908
authorGilbok Lee <gilbok.lee@samsung.com>
Tue, 16 Nov 2021 01:14:04 +0000 (10:14 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Tue, 16 Nov 2021 07:22:19 +0000 (16:22 +0900)
- Set stream continuity when fragment time changes

Change-Id: I592f4cd915c2d186462f771714de797c4b424521

ext/hls/gsthlsdemux.c

index 3e7da322eee27e2debfcb44deed9542684f0d3cc..25e7a07f1ed373a78971a29a4c6a3b1b3e775ec5 100644 (file)
@@ -1328,7 +1328,8 @@ gst_hls_demux_handle_buffer (GstAdaptiveDemux * demux,
 #ifdef TIZEN_FEATURE_HLSDEMUX_DISCONT
   if (!stream->discont && GST_CLOCK_TIME_IS_VALID (hls_stream->last_pcr)
       && GST_CLOCK_TIME_IS_VALID (last_pcr)) {
-    if (G_UNLIKELY (ABSDIFF (hls_stream->last_pcr, last_pcr) > 1 * GST_SECOND)) {
+    if (G_UNLIKELY (ABSDIFF (hls_stream->last_pcr, last_pcr) > 1 * GST_SECOND)
+        && (stream->fragment.timestamp != hls_stream->sequence_pos)) {
       GST_DEBUG_OBJECT (stream->pad,
           "Overwriting fragment timestamp [%" GST_TIME_FORMAT "] to [%"
           GST_TIME_FORMAT "]", GST_TIME_ARGS (stream->fragment.timestamp),