[vlc-commits] demux: ps: fix packheader probing (cid #1402130)

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 11:19:54 2017 +0100| [b486fad0d59d1d1f82653eb17e619b13fbc85611] | committer: Francois Cartegnie

demux: ps: fix packheader probing (cid #1402130)

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

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

diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index 87e0c6f..eb780f5 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -252,7 +252,9 @@ static int Demux2( demux_t *p_demux, bool b_end )
     {
         return 0;
     }
-    if( (i_id = ps_pkt_id( p_pkt )) >= 0xc0 )
+
+    i_id = ps_pkt_id( p_pkt );
+    if( i_id >= 0xc0 )
     {
         ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
         if( !ps_pkt_parse_pes( VLC_OBJECT(p_demux), p_pkt, tk->i_skip ) &&
@@ -267,10 +269,11 @@ static int Demux2( demux_t *p_demux, bool b_end )
                 tk->i_first_pts = p_pkt->i_pts;
             }
         }
-
-        if( i_id == PS_STREAM_ID_PACK_HEADER )
-            p_sys->b_have_pack = true;
     }
+
+    if( i_id == PS_STREAM_ID_PACK_HEADER )
+        p_sys->b_have_pack = true;
+
     block_Release( p_pkt );
     return 1;
 }



More information about the vlc-commits mailing list