Commit be47b965 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: ps: remove define

parent 13a816fd
......@@ -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;
......
......@@ -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;
......
......@@ -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 )
{
......
......@@ -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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment