[vlc-commits] demux: ts: add cc-check option for reliable transports

Francois Cartegnie git at videolan.org
Thu Jan 25 21:40:56 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan 25 21:33:49 2018 +0100| [fffeea6124f6a3fb9c086e9668c4757ebc740207] | committer: Francois Cartegnie

demux: ts: add cc-check option for reliable transports

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

 modules/demux/mpeg/ts.c | 8 +++++++-
 modules/demux/mpeg/ts.h | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 5d5f24fb27..f1291d5d18 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -111,6 +111,10 @@ static void Close ( vlc_object_t * );
     "Seek and position based on a percent byte position, not a PCR generated " \
     "time position. If seeking doesn't work property, turn on this option." )
 
+#define CC_CHECK_TEXT       "Check packets continuity counter"
+#define CC_CHECK_LONGTEXT   "Detect discontinuities and drop packet duplicates. " \
+                            "(bluRay sources are known broken and have false positives). "
+
 #define PCR_TEXT N_("Trust in-stream PCR")
 #define PCR_LONGTEXT N_("Use the stream PCR as a reference.")
 
@@ -148,6 +152,7 @@ vlc_module_begin ()
 
     add_bool( "ts-split-es", true, SPLIT_ES_TEXT, SPLIT_ES_LONGTEXT, false )
     add_bool( "ts-seek-percent", false, SEEK_PERCENT_TEXT, SEEK_PERCENT_LONGTEXT, true )
+    add_bool( "ts-cc-check", true, CC_CHECK_TEXT, CC_CHECK_LONGTEXT, true )
 
     add_obsolete_bool( "ts-silent" );
 
@@ -483,6 +488,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->b_canseek = false;
     p_sys->b_canfastseek = false;
     p_sys->b_ignore_time_for_positions = var_InheritBool( p_demux, "ts-seek-percent" );
+    p_sys->b_cc_check = var_InheritBool( p_demux, "ts-cc-check" );
 
     p_sys->standard = TS_STANDARD_AUTO;
     char *psz_standard = var_InheritString( p_demux, "ts-standard" );
@@ -2483,7 +2489,7 @@ static block_t * ProcessTSPacket( demux_t *p_demux, ts_pid_t *pid, block_t *p_pk
         * diff == 0 and duplicate packet (playload != 0) <- should we
         *   test the content ?
      */
-    if( b_payload )
+    if( b_payload && p_sys->b_cc_check )
     {
         const int i_diff = ( i_cc - pid->i_cc )&0x0f;
         if( i_diff == 1 )
diff --git a/modules/demux/mpeg/ts.h b/modules/demux/mpeg/ts.h
index 2b2ad16109..9f98aba936 100644
--- a/modules/demux/mpeg/ts.h
+++ b/modules/demux/mpeg/ts.h
@@ -62,6 +62,7 @@ struct demux_sys_t
     /* how many TS packet we read at once */
     unsigned    i_ts_read;
 
+    bool        b_cc_check;
     bool        b_ignore_time_for_positions;
 
     ts_standards_e standard;



More information about the vlc-commits mailing list