Commit a985c6f6 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: ts: move PAT creation to psi

parent 5d31d476
......@@ -416,7 +416,7 @@ static int Open( vlc_object_t *p_this )
free( p_sys );
return VLC_ENOMEM;
}
if( !dvbpsi_pat_attach( patpid->u.p_pat->handle, PATCallBack, p_demux ) )
if( !ts_psi_PAT_Attach( patpid, p_demux ) )
{
PIDRelease( p_demux, patpid );
vlc_mutex_destroy( &p_sys->csa_lock );
......
......@@ -55,6 +55,7 @@
#include <assert.h>
static void PIDFillFormat( demux_t *, ts_pes_t *p_pes, int i_stream_type, ts_es_data_type_t * );
static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt );
static void ValidateDVBMeta( demux_t *p_demux, int i_pid )
{
......@@ -92,7 +93,7 @@ static int PATCheck( demux_t *p_demux, dvbpsi_pat_t *p_pat )
return VLC_SUCCESS;
}
void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat )
static void PATCallBack( void *data, dvbpsi_pat_t *p_dvbpsipat )
{
demux_t *p_demux = data;
demux_sys_t *p_sys = p_demux->p_sys;
......@@ -1390,7 +1391,7 @@ static void FillPESFromDvbpsiES( demux_t *p_demux,
p_pes->p_es->fmt.i_id = p_dvbpsies->i_pid;
}
void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
{
demux_t *p_demux = data;
demux_sys_t *p_sys = p_demux->p_sys;
......@@ -1828,3 +1829,10 @@ error:
free( psz_dup );
return VLC_EGENERIC;
}
bool ts_psi_PAT_Attach( ts_pid_t *patpid, void *cbdata )
{
if( unlikely(patpid->type != TYPE_PAT || patpid->i_pid != TS_PSI_PAT_PID) )
return false;
return dvbpsi_pat_attach( patpid->u.p_pat->handle, PATCallBack, cbdata );
}
......@@ -19,6 +19,8 @@
#ifndef VLC_TS_PSI_H
#define VLC_TS_PSI_H
#include "ts_pid_fwd.h"
typedef enum
{
TS_PMT_REGISTRATION_NONE = 0,
......@@ -27,8 +29,7 @@ typedef enum
TS_PMT_REGISTRATION_ARIB,
} ts_pmt_registration_type_t;
void PATCallBack( void *, dvbpsi_pat_t * );
void PMTCallBack( void *, dvbpsi_pmt_t * );
bool ts_psi_PAT_Attach( ts_pid_t *, void * );
int UserPmt( demux_t *p_demux, const char * );
......
Supports Markdown
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