[vlc-commits] demux: timestamps_filter: change discontinuity detection trigger

Francois Cartegnie git at videolan.org
Tue Jan 28 20:39:45 CET 2020


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jan 27 18:42:30 2020 +0100| [4ca4fa19e7df620b5cae33f8fb8f231e67a2c5ed] | committer: Francois Cartegnie

demux: timestamps_filter: change discontinuity detection trigger

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ca4fa19e7df620b5cae33f8fb8f231e67a2c5ed
---

 modules/demux/timestamps_filter.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/demux/timestamps_filter.h b/modules/demux/timestamps_filter.h
index 5fc6b9326b..f56c4e7137 100644
--- a/modules/demux/timestamps_filter.h
+++ b/modules/demux/timestamps_filter.h
@@ -95,7 +95,11 @@ static bool timestamps_filter_push(const char *s, struct timestamps_filter_s *tf
 
         if(b_contiguous)
         {
-            const int64_t i_maxdiff = tf->mva.i_packet > MVA_PACKETS ? mva_get(&tf->mva) * 2 : CLOCK_FREQ;
+            int64_t i_maxdiff = 0;
+            if(tf->mva.i_packet > MVA_PACKETS)
+                i_maxdiff = mva_get(&tf->mva) * 2;
+            if(i_maxdiff < CLOCK_FREQ)
+                i_maxdiff = CLOCK_FREQ;
             if(llabs(i_dts - prev->dts) > i_maxdiff || b_discontinuity) /* Desync */
             {
                 prev->diff = mva_get(&tf->mva);



More information about the vlc-commits mailing list