Commit 49df5889 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: ts: rename PID(), fix OS/2 compilation

parent c1c71c9e
...@@ -464,7 +464,7 @@ static ts_psi_t *ts_psi_New( demux_t * ); ...@@ -464,7 +464,7 @@ static ts_psi_t *ts_psi_New( demux_t * );
static void ts_psi_Del( demux_t *, ts_psi_t * ); static void ts_psi_Del( demux_t *, ts_psi_t * );
/* Helpers */ /* Helpers */
static ts_pid_t *PID( demux_sys_t *, uint16_t i_pid ); static ts_pid_t *GetPID( demux_sys_t *, uint16_t i_pid );
static ts_pmt_t * GetProgramByID( demux_sys_t *, int i_program ); static ts_pmt_t * GetProgramByID( demux_sys_t *, int i_program );
static bool ProgramIsSelected( demux_sys_t *, uint16_t i_pgrm ); static bool ProgramIsSelected( demux_sys_t *, uint16_t i_pgrm );
static void UpdatePESFilters( demux_t *p_demux, bool b_all ); static void UpdatePESFilters( demux_t *p_demux, bool b_all );
...@@ -867,7 +867,7 @@ static void MissingPATPMTFixup( demux_t *p_demux ) ...@@ -867,7 +867,7 @@ static void MissingPATPMTFixup( demux_t *p_demux )
int i_pcr_pid = 0x1FFF; int i_pcr_pid = 0x1FFF;
int i_num_pes = 0; int i_num_pes = 0;
ts_pid_t *p_program_pid = PID( p_sys, i_program_pid ); ts_pid_t *p_program_pid = GetPID( p_sys, i_program_pid );
if( SEEN(p_program_pid) ) if( SEEN(p_program_pid) )
{ {
/* Find a free one */ /* Find a free one */
...@@ -875,7 +875,7 @@ static void MissingPATPMTFixup( demux_t *p_demux ) ...@@ -875,7 +875,7 @@ static void MissingPATPMTFixup( demux_t *p_demux )
i_program_pid <= MAX_ES_PID && SEEN(p_program_pid); i_program_pid <= MAX_ES_PID && SEEN(p_program_pid);
i_program_pid++ ) i_program_pid++ )
{ {
p_program_pid = PID( p_sys, i_program_pid ); p_program_pid = GetPID( p_sys, i_program_pid );
} }
} }
...@@ -910,7 +910,7 @@ static void MissingPATPMTFixup( demux_t *p_demux ) ...@@ -910,7 +910,7 @@ static void MissingPATPMTFixup( demux_t *p_demux )
.b_discontinuity = false .b_discontinuity = false
}; };
BuildPAT( PID(p_sys, 0)->u.p_pat->handle, BuildPAT( GetPID(p_sys, 0)->u.p_pat->handle,
&p_sys->pids.pat, BuildPATCallback, &p_sys->pids.pat, BuildPATCallback,
0, 1, 0, 1,
&patstream, &patstream,
...@@ -951,7 +951,7 @@ static void MissingPATPMTFixup( demux_t *p_demux ) ...@@ -951,7 +951,7 @@ static void MissingPATPMTFixup( demux_t *p_demux )
j++; j++;
} }
BuildPMT( PID(p_sys, 0)->u.p_pat->handle, VLC_OBJECT(p_demux), BuildPMT( GetPID(p_sys, 0)->u.p_pat->handle, VLC_OBJECT(p_demux),
p_program_pid, BuildPMTCallback, p_program_pid, BuildPMTCallback,
0, 1, 0, 1,
i_pcr_pid, i_pcr_pid,
...@@ -1026,7 +1026,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -1026,7 +1026,7 @@ static int Open( vlc_object_t *p_this )
} while (0) } while (0)
/* Init PAT handler */ /* Init PAT handler */
patpid = PID(p_sys, 0); patpid = GetPID(p_sys, 0);
if ( !PIDSetup( p_demux, TYPE_PAT, patpid, NULL ) ) if ( !PIDSetup( p_demux, TYPE_PAT, patpid, NULL ) )
{ {
vlc_mutex_destroy( &p_sys->csa_lock ); vlc_mutex_destroy( &p_sys->csa_lock );
...@@ -1043,24 +1043,24 @@ static int Open( vlc_object_t *p_this ) ...@@ -1043,24 +1043,24 @@ static int Open( vlc_object_t *p_this )
if( p_sys->b_dvb_meta ) if( p_sys->b_dvb_meta )
{ {
if( !PIDSetup( p_demux, TYPE_SDT, PID(p_sys, 0x11), NULL ) || if( !PIDSetup( p_demux, TYPE_SDT, GetPID(p_sys, 0x11), NULL ) ||
!PIDSetup( p_demux, TYPE_EIT, PID(p_sys, 0x12), NULL ) || !PIDSetup( p_demux, TYPE_EIT, GetPID(p_sys, 0x12), NULL ) ||
!PIDSetup( p_demux, TYPE_TDT, PID(p_sys, 0x14), NULL ) ) !PIDSetup( p_demux, TYPE_TDT, GetPID(p_sys, 0x14), NULL ) )
{ {
PIDRelease( p_demux, PID(p_sys, 0x11) ); PIDRelease( p_demux, GetPID(p_sys, 0x11) );
PIDRelease( p_demux, PID(p_sys, 0x12) ); PIDRelease( p_demux, GetPID(p_sys, 0x12) );
PIDRelease( p_demux, PID(p_sys, 0x14) ); PIDRelease( p_demux, GetPID(p_sys, 0x14) );
p_sys->b_dvb_meta = false; p_sys->b_dvb_meta = false;
} }
else else
{ {
VLC_DVBPSI_DEMUX_TABLE_INIT(PID(p_sys, 0x11), p_demux); VLC_DVBPSI_DEMUX_TABLE_INIT(GetPID(p_sys, 0x11), p_demux);
VLC_DVBPSI_DEMUX_TABLE_INIT(PID(p_sys, 0x12), p_demux); VLC_DVBPSI_DEMUX_TABLE_INIT(GetPID(p_sys, 0x12), p_demux);
VLC_DVBPSI_DEMUX_TABLE_INIT(PID(p_sys, 0x14), p_demux); VLC_DVBPSI_DEMUX_TABLE_INIT(GetPID(p_sys, 0x14), p_demux);
if( p_sys->b_access_control && if( p_sys->b_access_control &&
( SetPIDFilter( p_sys, PID(p_sys, 0x11), true ) || ( SetPIDFilter( p_sys, GetPID(p_sys, 0x11), true ) ||
SetPIDFilter( p_sys, PID(p_sys, 0x14), true ) || SetPIDFilter( p_sys, GetPID(p_sys, 0x14), true ) ||
SetPIDFilter( p_sys, PID(p_sys, 0x12), true ) ) SetPIDFilter( p_sys, GetPID(p_sys, 0x12), true ) )
) )
p_sys->b_access_control = false; p_sys->b_access_control = false;
} }
...@@ -1165,13 +1165,13 @@ static void Close( vlc_object_t *p_this ) ...@@ -1165,13 +1165,13 @@ static void Close( vlc_object_t *p_this )
demux_t *p_demux = (demux_t*)p_this; demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
PIDRelease( p_demux, PID(p_sys, 0) ); PIDRelease( p_demux, GetPID(p_sys, 0) );
if( p_sys->b_dvb_meta ) if( p_sys->b_dvb_meta )
{ {
PIDRelease( p_demux, PID(p_sys, 0x11) ); PIDRelease( p_demux, GetPID(p_sys, 0x11) );
PIDRelease( p_demux, PID(p_sys, 0x12) ); PIDRelease( p_demux, GetPID(p_sys, 0x12) );
PIDRelease( p_demux, PID(p_sys, 0x14) ); PIDRelease( p_demux, GetPID(p_sys, 0x14) );
} }
vlc_mutex_lock( &p_sys->csa_lock ); vlc_mutex_lock( &p_sys->csa_lock );
...@@ -1244,7 +1244,7 @@ static int Demux( demux_t *p_demux ) ...@@ -1244,7 +1244,7 @@ static int Demux( demux_t *p_demux )
bool b_wait_es = p_sys->i_pmt_es <= 0; bool b_wait_es = p_sys->i_pmt_es <= 0;
/* If we had no PAT within MIN_PAT_INTERVAL, create PAT/PMT from probed streams */ /* If we had no PAT within MIN_PAT_INTERVAL, create PAT/PMT from probed streams */
if( p_sys->i_pmt_es == 0 && !SEEN(PID(p_sys, 0)) && p_sys->patfix.b_pat_deadline ) if( p_sys->i_pmt_es == 0 && !SEEN(GetPID(p_sys, 0)) && p_sys->patfix.b_pat_deadline )
MissingPATPMTFixup( p_demux ); MissingPATPMTFixup( p_demux );
/* We read at most 100 TS packet or until a frame is completed */ /* We read at most 100 TS packet or until a frame is completed */
...@@ -1265,7 +1265,7 @@ static int Demux( demux_t *p_demux ) ...@@ -1265,7 +1265,7 @@ static int Demux( demux_t *p_demux )
} }
/* Parse the TS packet */ /* Parse the TS packet */
ts_pid_t *p_pid = PID( p_sys, PIDGet( p_pkt ) ); ts_pid_t *p_pid = GetPID( p_sys, PIDGet( p_pkt ) );
if( SCRAMBLED(*p_pid) != !!(p_pkt->p_buffer[3] & 0x80) ) if( SCRAMBLED(*p_pid) != !!(p_pkt->p_buffer[3] & 0x80) )
UpdateScrambledState( p_demux, p_pid, p_pkt->p_buffer[3] & 0x80 ); UpdateScrambledState( p_demux, p_pid, p_pkt->p_buffer[3] & 0x80 );
...@@ -1284,7 +1284,7 @@ static int Demux( demux_t *p_demux ) ...@@ -1284,7 +1284,7 @@ static int Demux( demux_t *p_demux )
} }
/* Probe streams to build PAT/PMT after MIN_PAT_INTERVAL in case we don't see any PAT */ /* Probe streams to build PAT/PMT after MIN_PAT_INTERVAL in case we don't see any PAT */
if( !SEEN( PID( p_sys, 0 ) ) && if( !SEEN( GetPID( p_sys, 0 ) ) &&
(p_pid->probed.i_type == 0 || p_pid->i_pid == p_sys->patfix.i_timesourcepid) && (p_pid->probed.i_type == 0 || p_pid->i_pid == p_sys->patfix.i_timesourcepid) &&
(p_pkt->p_buffer[1] & 0xC0) == 0x40 && /* Payload start but not corrupt */ (p_pkt->p_buffer[1] & 0xC0) == 0x40 && /* Payload start but not corrupt */
(p_pkt->p_buffer[3] & 0xD0) == 0x10 ) /* Has payload but is not encrypted */ (p_pkt->p_buffer[3] & 0xD0) == 0x10 ) /* Has payload but is not encrypted */
...@@ -1377,7 +1377,7 @@ static int DVBEventInformation( demux_t *p_demux, int64_t *pi_time, int64_t *pi_ ...@@ -1377,7 +1377,7 @@ static int DVBEventInformation( demux_t *p_demux, int64_t *pi_time, int64_t *pi_
static void UpdatePESFilters( demux_t *p_demux, bool b_all ) static void UpdatePESFilters( demux_t *p_demux, bool b_all )
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i=0; i< p_pat->programs.i_size; i++ ) for( int i=0; i< p_pat->programs.i_size; i++ )
{ {
ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt; ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt;
...@@ -1416,7 +1416,7 @@ static void UpdatePESFilters( demux_t *p_demux, bool b_all ) ...@@ -1416,7 +1416,7 @@ static void UpdatePESFilters( demux_t *p_demux, bool b_all )
/* Select pcr last in case it is handled by unselected ES */ /* Select pcr last in case it is handled by unselected ES */
if( p_pmt->i_pid_pcr > 0 ) if( p_pmt->i_pid_pcr > 0 )
{ {
SetPIDFilter( p_sys, PID(p_sys, p_pmt->i_pid_pcr), b_program_selected ); SetPIDFilter( p_sys, GetPID(p_sys, p_pmt->i_pid_pcr), b_program_selected );
if( b_program_selected ) if( b_program_selected )
msg_Dbg( p_demux, "enabling pcr pid %d from program %d", p_pmt->i_pid_pcr, p_pmt->i_number ); msg_Dbg( p_demux, "enabling pcr pid %d from program %d", p_pmt->i_pid_pcr, p_pmt->i_number );
} }
...@@ -1436,9 +1436,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1436,9 +1436,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if( PREPARSING || !i_first_program || p_sys->b_default_selection ) if( PREPARSING || !i_first_program || p_sys->b_default_selection )
{ {
if( likely(PID(p_sys, 0)->type == TYPE_PAT) ) if( likely(GetPID(p_sys, 0)->type == TYPE_PAT) )
{ {
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
/* Set default program for preparse time (no program has been selected) */ /* Set default program for preparse time (no program has been selected) */
for( int i = 0; i < p_pat->programs.i_size; i++ ) for( int i = 0; i < p_pat->programs.i_size; i++ )
{ {
...@@ -1619,7 +1619,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1619,7 +1619,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
else // All ES Mode else // All ES Mode
{ {
p_sys->b_es_all = true; p_sys->b_es_all = true;
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i = 0; i < p_pat->programs.i_size; i++ ) for( int i = 0; i < p_pat->programs.i_size; i++ )
ARRAY_APPEND( p_sys->programs, p_pat->programs.p_elems[i]->i_pid ); ARRAY_APPEND( p_sys->programs, p_pat->programs.p_elems[i]->i_pid );
UpdatePESFilters( p_demux, true ); UpdatePESFilters( p_demux, true );
...@@ -1709,10 +1709,10 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt ) ...@@ -1709,10 +1709,10 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt )
i_number = strtol( &psz[1], &psz, 0 ); i_number = strtol( &psz[1], &psz, 0 );
/* */ /* */
ts_pid_t *pmtpid = PID(p_sys, i_pid); ts_pid_t *pmtpid = GetPID(p_sys, i_pid);
msg_Dbg( p_demux, "user pmt specified (pid=%d,number=%d)", i_pid, i_number ); msg_Dbg( p_demux, "user pmt specified (pid=%d,number=%d)", i_pid, i_number );
if ( !PIDSetup( p_demux, TYPE_PMT, pmtpid, PID(p_sys, 0) ) ) if ( !PIDSetup( p_demux, TYPE_PMT, pmtpid, GetPID(p_sys, 0) ) )
goto error; goto error;
/* Dummy PMT */ /* Dummy PMT */
...@@ -1726,7 +1726,7 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt ) ...@@ -1726,7 +1726,7 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt )
goto error; goto error;
} }
ARRAY_APPEND( PID(p_sys, 0)->u.p_pat->programs, pmtpid ); ARRAY_APPEND( GetPID(p_sys, 0)->u.p_pat->programs, pmtpid );
psz = strchr( psz, '=' ); psz = strchr( psz, '=' );
if( psz ) if( psz )
...@@ -1748,9 +1748,9 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt ) ...@@ -1748,9 +1748,9 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt )
{ {
p_pmt->i_pid_pcr = i_pid; p_pmt->i_pid_pcr = i_pid;
} }
else if( PID(p_sys, i_pid)->type == TYPE_FREE ) else if( GetPID(p_sys, i_pid)->type == TYPE_FREE )
{ {
ts_pid_t *pid = PID(p_sys, i_pid); ts_pid_t *pid = GetPID(p_sys, i_pid);
char *psz_arg = strchr( psz_opt, '=' ); char *psz_arg = strchr( psz_opt, '=' );
if( psz_arg ) if( psz_arg )
...@@ -2732,7 +2732,7 @@ static void ReadyQueuesPostSeek( demux_t *p_demux ) ...@@ -2732,7 +2732,7 @@ static void ReadyQueuesPostSeek( demux_t *p_demux )
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i=0; i< p_pat->programs.i_size; i++ ) for( int i=0; i< p_pat->programs.i_size; i++ )
{ {
ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt; ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt;
...@@ -2812,8 +2812,8 @@ static int SeekToTime( demux_t *p_demux, ts_pmt_t *p_pmt, int64_t i_scaledtime ) ...@@ -2812,8 +2812,8 @@ static int SeekToTime( demux_t *p_demux, ts_pmt_t *p_pmt, int64_t i_scaledtime )
i_pos = stream_Tell( p_sys->stream ); i_pos = stream_Tell( p_sys->stream );
int i_pid = PIDGet( p_pkt ); int i_pid = PIDGet( p_pkt );
if( i_pid != 0x1FFF && PID(p_sys, i_pid)->type == TYPE_PES && if( i_pid != 0x1FFF && GetPID(p_sys, i_pid)->type == TYPE_PES &&
PID(p_sys, i_pid)->p_parent->u.p_pmt == p_pmt && GetPID(p_sys, i_pid)->p_parent->u.p_pmt == p_pmt &&
(p_pkt->p_buffer[1] & 0xC0) == 0x40 && /* Payload start but not corrupt */ (p_pkt->p_buffer[1] & 0xC0) == 0x40 && /* Payload start but not corrupt */
(p_pkt->p_buffer[3] & 0xD0) == 0x10 /* Has payload but is not encrypted */ (p_pkt->p_buffer[3] & 0xD0) == 0x10 /* Has payload but is not encrypted */
) )
...@@ -2869,7 +2869,7 @@ static int SeekToTime( demux_t *p_demux, ts_pmt_t *p_pmt, int64_t i_scaledtime ) ...@@ -2869,7 +2869,7 @@ static int SeekToTime( demux_t *p_demux, ts_pmt_t *p_pmt, int64_t i_scaledtime )
return VLC_SUCCESS; return VLC_SUCCESS;
} }
static ts_pid_t *PID( demux_sys_t *p_sys, uint16_t i_pid ) static ts_pid_t *GetPID( demux_sys_t *p_sys, uint16_t i_pid )
{ {
switch( i_pid ) switch( i_pid )
{ {
...@@ -2921,10 +2921,10 @@ static ts_pid_t *PID( demux_sys_t *p_sys, uint16_t i_pid ) ...@@ -2921,10 +2921,10 @@ static ts_pid_t *PID( demux_sys_t *p_sys, uint16_t i_pid )
static ts_pmt_t * GetProgramByID( demux_sys_t *p_sys, int i_program ) static ts_pmt_t * GetProgramByID( demux_sys_t *p_sys, int i_program )
{ {
if(unlikely(PID(p_sys, 0)->type != TYPE_PAT)) if(unlikely(GetPID(p_sys, 0)->type != TYPE_PAT))
return NULL; return NULL;
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i = 0; i < p_pat->programs.i_size; i++ ) for( int i = 0; i < p_pat->programs.i_size; i++ )
{ {
assert(p_pat->programs.p_elems[i]->type == TYPE_PMT); assert(p_pat->programs.p_elems[i]->type == TYPE_PMT);
...@@ -2953,7 +2953,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_ ...@@ -2953,7 +2953,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_
} }
const int i_pid = PIDGet( p_pkt ); const int i_pid = PIDGet( p_pkt );
ts_pid_t *p_pid = PID(p_sys, i_pid); ts_pid_t *p_pid = GetPID(p_sys, i_pid);
p_pid->i_flags |= FLAG_SEEN; p_pid->i_flags |= FLAG_SEEN;
...@@ -2993,7 +2993,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_ ...@@ -2993,7 +2993,7 @@ static int ProbeChunk( demux_t *p_demux, int i_program, bool b_end, int64_t *pi_
if( *pi_pcr != -1 ) if( *pi_pcr != -1 )
{ {
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i=0; i<p_pat->programs.i_size; i++ ) for( int i=0; i<p_pat->programs.i_size; i++ )
{ {
ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt; ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt;
...@@ -3097,7 +3097,7 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr ) ...@@ -3097,7 +3097,7 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr )
{ {
mtime_t i_mindts = -1; mtime_t i_mindts = -1;
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i=0; i< p_pat->programs.i_size; i++ ) for( int i=0; i< p_pat->programs.i_size; i++ )
{ {
ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt; ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt;
...@@ -3147,11 +3147,11 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk ) ...@@ -3147,11 +3147,11 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk )
pid->probed.i_pcr_count++; pid->probed.i_pcr_count++;
if(unlikely(PID(p_sys, 0)->type != TYPE_PAT)) if(unlikely(GetPID(p_sys, 0)->type != TYPE_PAT))
return; return;
/* Search program and set the PCR */ /* Search program and set the PCR */
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i = 0; i < p_pat->programs.i_size; i++ ) for( int i = 0; i < p_pat->programs.i_size; i++ )
{ {
ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt; ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt;
...@@ -3530,9 +3530,9 @@ static void ValidateDVBMeta( demux_t *p_demux, int i_pid ) ...@@ -3530,9 +3530,9 @@ static void ValidateDVBMeta( demux_t *p_demux, int i_pid )
/* This doesn't look like a DVB stream so don't try /* This doesn't look like a DVB stream so don't try
* parsing the SDT/EDT/TDT */ * parsing the SDT/EDT/TDT */
PIDRelease( p_demux, PID(p_sys, 0x11) ); PIDRelease( p_demux, GetPID(p_sys, 0x11) );
PIDRelease( p_demux, PID(p_sys, 0x12) ); PIDRelease( p_demux, GetPID(p_sys, 0x12) );
PIDRelease( p_demux, PID(p_sys, 0x14) ); PIDRelease( p_demux, GetPID(p_sys, 0x14) );
p_sys->b_dvb_meta = false; p_sys->b_dvb_meta = false;
} }
...@@ -3588,7 +3588,7 @@ static char *EITConvertToUTF8( demux_t *p_demux, ...@@ -3588,7 +3588,7 @@ static char *EITConvertToUTF8( demux_t *p_demux,
static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt ) static void SDTCallBack( demux_t *p_demux, dvbpsi_sdt_t *p_sdt )
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
ts_pid_t *sdt = PID(p_sys, 0x11); ts_pid_t *sdt = GetPID(p_sys, 0x11);
dvbpsi_sdt_service_t *p_srv; dvbpsi_sdt_service_t *p_srv;
msg_Dbg( p_demux, "SDTCallBack called" ); msg_Dbg( p_demux, "SDTCallBack called" );
...@@ -4023,7 +4023,7 @@ static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id, ...@@ -4023,7 +4023,7 @@ static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id,
msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)", msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
i_table_id, i_table_id, i_extension, i_extension ); i_table_id, i_table_id, i_extension, i_extension );
#endif #endif
if( PID(p_sys, 0)->u.p_pat->i_version != -1 && i_table_id == 0x42 ) if( GetPID(p_sys, 0)->u.p_pat->i_version != -1 && i_table_id == 0x42 )
{ {
msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)", msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
i_table_id, i_table_id, i_extension, i_extension ); i_table_id, i_table_id, i_extension, i_extension );
...@@ -4031,7 +4031,7 @@ static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id, ...@@ -4031,7 +4031,7 @@ static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id,
if( !dvbpsi_sdt_attach( h, i_table_id, i_extension, (dvbpsi_sdt_callback)SDTCallBack, p_demux ) ) if( !dvbpsi_sdt_attach( h, i_table_id, i_extension, (dvbpsi_sdt_callback)SDTCallBack, p_demux ) )
msg_Err( p_demux, "PSINewTableCallback: failed attaching SDTCallback" ); msg_Err( p_demux, "PSINewTableCallback: failed attaching SDTCallback" );
} }
else if( PID(p_sys, 0x11)->u.p_psi->i_version != -1 && else if( GetPID(p_sys, 0x11)->u.p_psi->i_version != -1 &&
( i_table_id == 0x4e || /* Current/Following */ ( i_table_id == 0x4e || /* Current/Following */
(i_table_id >= 0x50 && i_table_id <= 0x5f) ) ) /* Schedule */ (i_table_id >= 0x50 && i_table_id <= 0x5f) ) ) /* Schedule */
{ {
...@@ -4045,7 +4045,7 @@ static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id, ...@@ -4045,7 +4045,7 @@ static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id,
if( !dvbpsi_eit_attach( h, i_table_id, i_extension, cb, p_demux ) ) if( !dvbpsi_eit_attach( h, i_table_id, i_extension, cb, p_demux ) )
msg_Err( p_demux, "PSINewTableCallback: failed attaching EITCallback" ); msg_Err( p_demux, "PSINewTableCallback: failed attaching EITCallback" );
} }
else if( PID(p_sys, 0x11)->u.p_psi->i_version != -1 && else if( GetPID(p_sys, 0x11)->u.p_psi->i_version != -1 &&
(i_table_id == 0x70 /* TDT */ || i_table_id == 0x73 /* TOT */) ) (i_table_id == 0x70 /* TDT */ || i_table_id == 0x73 /* TOT */) )
{ {
msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)", msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
...@@ -5059,7 +5059,7 @@ static void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid, bool b_create_delay ...@@ -5059,7 +5059,7 @@ static void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid, bool b_create_delay
if( b_create_delayed ) if( b_create_delayed )
{ {
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
for( int i=0; i< p_pat->programs.i_size; i++ ) for( int i=0; i< p_pat->programs.i_size; i++ )
{ {
ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt; ts_pmt_t *p_pmt = p_pat->programs.p_elems[i]->u.p_pmt;
...@@ -5094,13 +5094,13 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt ) ...@@ -5094,13 +5094,13 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
msg_Dbg( p_demux, "PMTCallBack called" ); msg_Dbg( p_demux, "PMTCallBack called" );
if (unlikely(PID(p_sys, 0)->type != TYPE_PAT)) if (unlikely(GetPID(p_sys, 0)->type != TYPE_PAT))
{ {
assert(PID(p_sys, 0)->type == TYPE_PAT); assert(GetPID(p_sys, 0)->type == TYPE_PAT);
dvbpsi_pmt_delete(p_dvbpsipmt); dvbpsi_pmt_delete(p_dvbpsipmt);
} }
const ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; const ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
/* First find this PMT declared in PAT */ /* First find this PMT declared in PAT */
for( int i = 0; !pmtpid && i < p_pat->programs.i_size; i++ ) for( int i = 0; !pmtpid && i < p_pat->programs.i_size; i++ )
...@@ -5152,7 +5152,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt ) ...@@ -5152,7 +5152,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
ValidateDVBMeta( p_demux, p_pmt->i_pid_pcr ); ValidateDVBMeta( p_demux, p_pmt->i_pid_pcr );
if( ProgramIsSelected( p_sys, p_pmt->i_number ) ) if( ProgramIsSelected( p_sys, p_pmt->i_number ) )
SetPIDFilter( p_sys, PID(p_sys, p_pmt->i_pid_pcr), true ); /* Set demux filter */ SetPIDFilter( p_sys, GetPID(p_sys, p_pmt->i_pid_pcr), true ); /* Set demux filter */
/* Parse PMT descriptors */ /* Parse PMT descriptors */
ts_pmt_registration_type_t registration_type = TS_PMT_REGISTRATION_NONE; ts_pmt_registration_type_t registration_type = TS_PMT_REGISTRATION_NONE;
...@@ -5238,7 +5238,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt ) ...@@ -5238,7 +5238,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
bool b_reusing_pid = false; bool b_reusing_pid = false;
ts_pes_t *p_pes; ts_pes_t *p_pes;
ts_pid_t *pespid = PID(p_sys, p_dvbpsies->i_pid); ts_pid_t *pespid = GetPID(p_sys, p_dvbpsies->i_pid);
if ( pespid->type == TYPE_PES && pespid->p_parent->u.p_pmt->i_number != p_pmt->i_number ) if ( pespid->type == TYPE_PES && pespid->p_parent->u.p_pmt->i_number != p_pmt->i_number )
{ {
msg_Warn( p_demux, " * PMT wants to get a share or pid %d (unsupported)", pespid->i_pid ); msg_Warn( p_demux, " * PMT wants to get a share or pid %d (unsupported)", pespid->i_pid );
...@@ -5352,7 +5352,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt ) ...@@ -5352,7 +5352,7 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
PIDFillFormat( &p_pes->es.fmt, p_dvbpsies->i_type, &p_pes->data_type ); PIDFillFormat( &p_pes->es.fmt, p_dvbpsies->i_type, &p_pes->data_type );
p_pes->i_stream_type = p_dvbpsies->i_type; p_pes->i_stream_type = p_dvbpsies->i_type;
pespid->i_flags |= SEEN(PID(p_sys, p_dvbpsies->i_pid)); pespid->i_flags |= SEEN(GetPID(p_sys, p_dvbpsies->i_pid));
bool b_registration_applied = false; bool b_registration_applied = false;
if ( p_dvbpsies->i_type >= 0x80 ) /* non standard, extensions */ if ( p_dvbpsies->i_type >= 0x80 ) /* non standard, extensions */
...@@ -5533,14 +5533,14 @@ static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat ) ...@@ -5533,14 +5533,14 @@ static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat )
demux_t *p_demux = data; demux_t *p_demux = data;
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
dvbpsi_pat_program_t *p_program; dvbpsi_pat_program_t *p_program;
ts_pid_t *patpid = PID(p_sys, 0); ts_pid_t *patpid = GetPID(p_sys, 0);
ts_pat_t *p_pat = PID(p_sys, 0)->u.p_pat; ts_pat_t *p_pat = GetPID(p_sys, 0)->u.p_pat;
patpid->i_flags |= FLAG_SEEN; patpid->i_flags |= FLAG_SEEN;
msg_Dbg( p_demux, "PATCallBack called" ); msg_Dbg( p_demux, "PATCallBack called" );
if(unlikely( PID(p_sys, 0)->type != TYPE_PAT )) if(unlikely( GetPID(p_sys, 0)->type != TYPE_PAT ))
{ {
msg_Warn( p_demux, "PATCallBack called on invalid pid" ); msg_Warn( p_demux, "PATCallBack called on invalid pid" );
return; return;
...@@ -5575,7 +5575,7 @@ static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat ) ...@@ -5575,7 +5575,7 @@ static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat )
if( p_program->i_number == 0 ) if( p_program->i_number == 0 )
continue; continue;
ts_pid_t *pmtpid = PID(p_sys, p_program->i_pid); ts_pid_t *pmtpid = GetPID(p_sys, p_program->i_pid);
ValidateDVBMeta( p_demux, p_program->i_pid ); ValidateDVBMeta( p_demux, p_program->i_pid );
......
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