Commit 94f0635d authored by François Cartegnie's avatar François Cartegnie 🤞

input: add input_item_SetEpgEvent

parent 710d099a
......@@ -35,6 +35,7 @@ void input_item_SetPreparsed( input_item_t *p_i, bool b_preparsed );
void input_item_SetArtNotFound( input_item_t *p_i, bool b_not_found );
void input_item_SetArtFetched( input_item_t *p_i, bool b_art_fetched );
void input_item_SetEpg( input_item_t *p_item, const vlc_epg_t *p_epg );
void input_item_SetEpgEvent( input_item_t *p_item, const vlc_epg_event_t *p_epg_evt );
void input_item_SetEpgOffline( input_item_t * );
/**
......
......@@ -897,6 +897,41 @@ void input_item_MergeInfos( input_item_t *p_item, info_category_t *p_cat )
vlc_event_send( &p_item->event_manager, &event );
}
void input_item_SetEpgEvent( input_item_t *p_item, const vlc_epg_event_t *p_epg_evt )
{
bool b_changed = false;
vlc_mutex_lock( &p_item->lock );
for( int i = 0; i < p_item->i_epg; i++ )
{
vlc_epg_t *p_epg = p_item->pp_epg[i];
for( size_t j = 0; j < p_epg->i_event; j++ )
{
/* Same event can exist in more than one table */
if( p_epg->pp_event[j]->i_id == p_epg_evt->i_id )
{
vlc_epg_event_t *p_dup = vlc_epg_event_Duplicate( p_epg_evt );
if( p_dup )
{
if( p_epg->p_current == p_epg->pp_event[j] )
p_epg->p_current = p_dup;
vlc_epg_event_Delete( p_epg->pp_event[j] );
p_epg->pp_event[j] = p_dup;
b_changed = true;
}
break;
}
}
}
vlc_mutex_unlock( &p_item->lock );
if ( b_changed )
{
vlc_event_t event = { .type = vlc_InputItemInfoChanged, };
vlc_event_send( &p_item->event_manager, &event );
}
}
#define EPG_DEBUG
void input_item_SetEpg( input_item_t *p_item, const vlc_epg_t *p_update )
{
......
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