Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
32bd499b by François Cartegnie at 2024-01-25T11:12:57+00:00
demux: ts: don't split pkt on overflow for aligned cases

useless as the startcode always lies in first bytes
if there's no PUSI violation

- - - - -


2 changed files:

- modules/demux/mpeg/ts_pes.c
- test/modules/demux/ts_pes.c


Changes:

=====================================
modules/demux/mpeg/ts_pes.c
=====================================
@@ -268,8 +268,9 @@ bool ts_pes_Gather( ts_pes_parse_callback *cb,
             assert( p_pes->gather.i_data_size > p_pes->gather.i_gathered ||
                     p_pes->gather.i_data_size == 0 );
 
-            /* If we started reading a fixed size */
-            if( p_pes->gather.i_data_size > p_pes->gather.i_gathered && 
!b_single_payload )
+            /* If we started reading a fixed size that might not end on 
boundary */
+            if( unlikely(!b_aligned_ts_payload) &&
+                p_pes->gather.i_data_size > p_pes->gather.i_gathered )
             {
                 const size_t i_remain = p_pes->gather.i_data_size - 
p_pes->gather.i_gathered;
                 /* Append whole block */


=====================================
test/modules/demux/ts_pes.c
=====================================
@@ -173,7 +173,7 @@ int main(void)
     ASSERT(output);
     block_ChainProperties(output, &outputcount, &outputsize, NULL);
     ASSERT(outputcount == 1);
-    ASSERT(outputsize == 256);
+    ASSERT(outputsize == 300);
     RESET;
 
     /* no packets assembly from unit start, early termination by fixed size */



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/32bd499b12bffabec98bfe51dbdcdc9490e3c81e

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/commit/32bd499b12bffabec98bfe51dbdcdc9490e3c81e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to