[vlc-commits] demux: ps: remove define

Francois Cartegnie git at videolan.org
Sun Jul 9 14:51:34 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jul  9 14:21:51 2017 +0200| [be47b9655e3d8152899378c25c8910c6519a3a6a] | committer: Francois Cartegnie

demux: ps: remove define

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

 modules/access/dvdnav.c  | 8 ++++----
 modules/access/dvdread.c | 4 ++--
 modules/demux/mpeg/ps.c  | 4 ++--
 modules/demux/mpeg/ps.h  | 8 +-------
 4 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 0c7fec8a07..7d8ac58efd 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -1300,7 +1300,7 @@ static void ESSubtitleUpdate( demux_t *p_demux )
     /* dvdnav_get_active_spu_stream sets (in)visibility flag as 0xF0 */
     if( i_spu >= 0 && i_spu <= 0x1f )
     {
-        ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(0xbd20 + i_spu)];
+        ps_track_t *tk = &p_sys->tk[ps_id_to_tk(0xbd20 + i_spu)];
 
         ESNew( p_demux, 0xbd20 + i_spu );
 
@@ -1318,7 +1318,7 @@ static void ESSubtitleUpdate( demux_t *p_demux )
     {
         for( i_spu = 0; i_spu <= 0x1F; i_spu++ )
         {
-            ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(0xbd20 + i_spu)];
+            ps_track_t *tk = &p_sys->tk[ps_id_to_tk(0xbd20 + i_spu)];
             if( tk->es )
             {
                 es_out_Control( p_demux->out, ES_OUT_SET_ES_STATE, tk->es,
@@ -1383,7 +1383,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
             int i_id = ps_pkt_id( p_pkt );
             if( i_id >= 0xc0 )
             {
-                ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
+                ps_track_t *tk = &p_sys->tk[ps_id_to_tk(i_id)];
 
                 if( !tk->b_configured )
                 {
@@ -1436,7 +1436,7 @@ static void DemuxForceStill( demux_t *p_demux )
 static void ESNew( demux_t *p_demux, int i_id )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    ps_track_t  *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
+    ps_track_t  *tk = &p_sys->tk[ps_id_to_tk(i_id)];
     bool  b_select = false;
 
     if( tk->b_configured ) return;
diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 747e511475..6312d1d6a5 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -617,7 +617,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
             int i_id = ps_pkt_id( p_pkt );
             if( i_id >= 0xc0 )
             {
-                ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
+                ps_track_t *tk = &p_sys->tk[ps_id_to_tk(i_id)];
 
                 if( !tk->b_configured )
                 {
@@ -654,7 +654,7 @@ static int DemuxBlock( demux_t *p_demux, const uint8_t *p, int len )
 static void ESNew( demux_t *p_demux, int i_id, int i_lang )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
-    ps_track_t  *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
+    ps_track_t  *tk = &p_sys->tk[ps_id_to_tk(i_id)];
     char psz_language[3];
 
     if( tk->b_configured ) return;
diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index c90cad543d..bf8abb75bb 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -299,7 +299,7 @@ static int Probe( demux_t *p_demux, bool b_end )
     i_id = ps_pkt_id( p_pkt );
     if( i_id >= 0xc0 )
     {
-        ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
+        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 ) &&
              p_pkt->i_pts > VLC_TS_INVALID )
         {
@@ -515,7 +515,7 @@ static int Demux( demux_t *p_demux )
             }
 
             bool b_new = false;
-            ps_track_t *tk = &p_sys->tk[PS_ID_TO_TK(i_id)];
+            ps_track_t *tk = &p_sys->tk[ps_id_to_tk(i_id)];
 
             if( !tk->b_configured )
             {
diff --git a/modules/demux/mpeg/ps.h b/modules/demux/mpeg/ps.h
index 2e135d6362..eef47450fe 100644
--- a/modules/demux/mpeg/ps.h
+++ b/modules/demux/mpeg/ps.h
@@ -37,10 +37,6 @@
 
 /* 256-0xC0 for normal stream, 256 for 0xbd stream, 256 for 0xfd stream, 8 for 0xa0 AOB stream */
 #define PS_TK_COUNT (256+256+256+8 - 0xc0)
-#if 0
-#define PS_ID_TO_TK( id ) ((id) <= 0xff ? (id) - 0xc0 : \
-            ((id)&0xff) + (((id)&0xff00) == 0xbd00 ? 256-0xC0 : 512-0xc0) )
-#else
 static inline int ps_id_to_tk( unsigned i_id )
 {
     if( i_id <= 0xff )
@@ -52,8 +48,6 @@ static inline int ps_id_to_tk( unsigned i_id )
     else
         return 768-0xc0 + (i_id & 0x07);
 }
-#define PS_ID_TO_TK( id ) ps_id_to_tk( id )
-#endif
 
 typedef struct ps_psm_t ps_psm_t;
 static inline int ps_id_to_type( const ps_psm_t *, int );
@@ -485,7 +479,7 @@ static inline int ps_pkt_parse_system( block_t *p_pkt, ps_psm_t *p_psm,
         if( i_id < 0xc0 )
             continue;
 
-        int i_tk = PS_ID_TO_TK( i_id );
+        int i_tk = ps_id_to_tk( i_id );
         if( !tk[i_tk].b_configured )
             ps_track_fill( &tk[i_tk], p_psm, i_id, NULL, false );
     }



More information about the vlc-commits mailing list