[vlc-commits] demux: ps: don't check padding zeroes for cdxa

Francois Cartegnie git at videolan.org
Thu Mar 9 16:31:50 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Mar  9 16:20:45 2017 +0100| [1cad163b15e0be2277a8af31a8accf608f2b7380] | committer: Francois Cartegnie

demux: ps: don't check padding zeroes for cdxa

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

 modules/demux/mpeg/ps.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index 4f9ebae..726ed70 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -778,20 +778,14 @@ static int ps_pkt_resynch( stream_t *s, int format, bool b_pack )
            PES sizes and frelling up to UINT16_MAX bytes followed by 24 bytes CDXA Header */
         if( format == CDXA_PS && i_skip == 0 && i_peek >= 48 )
         {
-            size_t i = 0;
-            while( i<24 && p_peek[i] == 0 )
-                i++;
-            if( i == 20 )
+            const uint8_t cdxasynccode[12] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
+                                               0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
+            if( !memcmp( &p_peek[24], cdxasynccode, 12 ) )
             {
-                const uint8_t cdxasynccode[12] = { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
-                                                   0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
-                if( !memcmp( &p_peek[24], cdxasynccode, 12 ) )
-                {
-                    i_peek -= 48;
-                    p_peek += 48;
-                    i_skip += 48;
-                    continue;
-                }
+                i_peek -= 48;
+                p_peek += 48;
+                i_skip += 48;
+                continue;
             }
         }
 



More information about the vlc-commits mailing list