mirror of https://code.videolan.org/videolan/vlc
epg: differentiate schedule eit from running info
This commit is contained in:
parent
fb11b15528
commit
60f64ac9c9
|
@ -45,12 +45,12 @@ typedef struct
|
|||
typedef struct
|
||||
{
|
||||
char *psz_name;
|
||||
const vlc_epg_event_t *p_current; /* Can be null or should be the same than one of pp_event entry */
|
||||
uint32_t i_id; /* Unique identifier for this table / events (partial sets) */
|
||||
uint16_t i_source_id;/* Channel / Program reference id this epg relates to */
|
||||
|
||||
size_t i_event;
|
||||
vlc_epg_event_t **pp_event;
|
||||
bool b_present; /* Contains present/following or similar, and sets below */
|
||||
const vlc_epg_event_t *p_current; /* Can be null or should be the same than one of pp_event entry */
|
||||
} vlc_epg_t;
|
||||
|
||||
/**
|
||||
|
|
|
@ -463,6 +463,9 @@ static void ATSC_EIT_Callback( void *p_pid, dvbpsi_atsc_eit_t* p_eit )
|
|||
return;
|
||||
}
|
||||
|
||||
/* Use first table as present/following (not split like DVB) */
|
||||
p_epg->b_present = (i_table_type == ATSC_TABLE_TYPE_EIT_0);
|
||||
|
||||
if( !p_basectx->p_a65 && !(p_basectx->p_a65 = atsc_a65_handle_New( NULL )) )
|
||||
goto end;
|
||||
|
||||
|
@ -486,7 +489,7 @@ static void ATSC_EIT_Callback( void *p_pid, dvbpsi_atsc_eit_t* p_eit )
|
|||
}
|
||||
|
||||
/* Update epg current time from system time ( required for pruning ) */
|
||||
if( i_current_event_start_time )
|
||||
if( p_epg->b_present && i_current_event_start_time )
|
||||
{
|
||||
vlc_epg_SetCurrent( p_epg, i_current_event_start_time );
|
||||
ts_pat_t *p_pat = ts_pid_Get(&p_demux->p_sys->pids, 0)->u.p_pat;
|
||||
|
|
|
@ -377,7 +377,6 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
|
|||
demux_sys_t *p_sys = p_demux->p_sys;
|
||||
dvbpsi_eit_event_t *p_evt;
|
||||
vlc_epg_t *p_epg;
|
||||
//bool b_current_following = (p_eit->i_table_id == 0x4e);
|
||||
|
||||
msg_Dbg( p_demux, "EITCallBack called" );
|
||||
if( !p_eit->b_current_next )
|
||||
|
@ -594,7 +593,7 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
|
|||
|
||||
if( p_epg->i_event > 0 )
|
||||
{
|
||||
if( p_epg->p_current )
|
||||
if( p_epg->b_present && p_epg->p_current )
|
||||
{
|
||||
ts_pat_t *p_pat = ts_pid_Get(&p_sys->pids, 0)->u.p_pat;
|
||||
ts_pmt_t *p_pmt = ts_pat_Get_pmt(p_pat, p_eit->i_extension);
|
||||
|
@ -604,6 +603,7 @@ static void EITCallBack( demux_t *p_demux, dvbpsi_eit_t *p_eit )
|
|||
p_pmt->eit.i_event_length = p_epg->p_current->i_duration;
|
||||
}
|
||||
}
|
||||
p_epg->b_present = (p_eit->i_table_id == 0x4e);
|
||||
es_out_Control( p_demux->out, ES_OUT_SET_GROUP_EPG, p_eit->i_extension, p_epg );
|
||||
}
|
||||
vlc_epg_Delete( p_epg );
|
||||
|
|
|
@ -1363,10 +1363,10 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg
|
|||
input_SendEventMetaEpg( p_sys->p_input );
|
||||
|
||||
/* Update now playing */
|
||||
if( p_epg->p_current || p_epg->i_event == 0 )
|
||||
if( p_epg->b_present && p_pgrm->p_meta &&
|
||||
( p_epg->p_current || p_epg->i_event == 0 ) )
|
||||
{
|
||||
if( p_pgrm->p_meta )
|
||||
vlc_meta_SetNowPlaying( p_pgrm->p_meta, NULL );
|
||||
vlc_meta_SetNowPlaying( p_pgrm->p_meta, NULL );
|
||||
}
|
||||
|
||||
vlc_mutex_lock( &p_item->lock );
|
||||
|
@ -1374,7 +1374,7 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg
|
|||
{
|
||||
const vlc_epg_t *p_tmp = p_item->pp_epg[i];
|
||||
|
||||
if( p_tmp->i_source_id == p_pgrm->i_id )
|
||||
if( p_tmp->b_present && p_tmp->i_source_id == p_pgrm->i_id )
|
||||
{
|
||||
const char *psz_name = ( p_tmp->p_current ) ? p_tmp->p_current->psz_name : NULL;
|
||||
if( !p_pgrm->p_meta )
|
||||
|
|
|
@ -87,6 +87,7 @@ static void vlc_epg_Init( vlc_epg_t *p_epg, uint32_t i_id, uint16_t i_source_id
|
|||
p_epg->i_source_id = i_source_id;
|
||||
p_epg->psz_name = NULL;
|
||||
p_epg->p_current = NULL;
|
||||
p_epg->b_present = false;
|
||||
TAB_INIT( p_epg->i_event, p_epg->pp_event );
|
||||
}
|
||||
|
||||
|
@ -270,6 +271,7 @@ vlc_epg_t * vlc_epg_Duplicate( const vlc_epg_t *p_src )
|
|||
if( p_epg )
|
||||
{
|
||||
p_epg->psz_name = ( p_src->psz_name ) ? strdup( p_src->psz_name ) : NULL;
|
||||
p_epg->b_present = p_src->b_present;
|
||||
for( size_t i=0; i<p_src->i_event; i++ )
|
||||
{
|
||||
vlc_epg_event_t *p_dup = vlc_epg_event_Duplicate( p_src->pp_event[i] );
|
||||
|
|
Loading…
Reference in New Issue