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

es_out: add ES_OUT_SET_EPG_TIME

Because EIT time/date is not correlated to PCR,
GET_TIME (relative) or current time(),
time base must be the one provided by SI tables. (TOT/TDT)
parent 003443e0
......@@ -72,6 +72,8 @@ enum es_out_query_e
/* Set epg for group (dynamic) (The vlc_epg_t is not modified nor released) */
ES_OUT_SET_GROUP_EPG, /* arg1=int i_group arg2=const vlc_epg_t * */
ES_OUT_SET_GROUP_EPG_EVENT, /* arg1=int i_group arg2=const vlc_epg_event_t * */
ES_OUT_SET_EPG_TIME, /* arg1=int int64_t */
/* */
ES_OUT_DEL_GROUP, /* arg1=int i_group */
......
......@@ -1413,6 +1413,15 @@ static void EsOutProgramEpg( es_out_t *out, int i_group, const vlc_epg_t *p_epg
free( psz_cat );
}
static void EsOutEpgTime( es_out_t *out, int64_t time )
{
es_out_sys_t *p_sys = out->p_sys;
input_thread_t *p_input = p_sys->p_input;
input_item_t *p_item = input_priv(p_input)->p_item;
input_item_SetEpgTime( p_item, time );
}
static void EsOutProgramUpdateScrambled( es_out_t *p_out, es_out_pgrm_t *p_pgrm )
{
es_out_sys_t *p_sys = p_out->p_sys;
......@@ -2495,6 +2504,13 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
EsOutProgramEpgEvent( out, i_group, p_evt );
return VLC_SUCCESS;
}
case ES_OUT_SET_EPG_TIME:
{
int i64 = (int64_t)va_arg( args, int64_t );
EsOutEpgTime( out, i64 );
return VLC_SUCCESS;
}
case ES_OUT_DEL_GROUP:
{
......
......@@ -638,6 +638,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
case ES_OUT_SET_GROUP_META:
case ES_OUT_SET_GROUP_EPG:
case ES_OUT_SET_GROUP_EPG_EVENT:
case ES_OUT_SET_EPG_TIME:
case ES_OUT_SET_ES_SCRAMBLED_STATE:
case ES_OUT_DEL_GROUP:
case ES_OUT_SET_META:
......@@ -1467,6 +1468,9 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
}
break;
}
case ES_OUT_SET_EPG_TIME: /* arg1=int64_t (seconds) */
p_cmd->u.control.u.i_i64 = (int64_t)va_arg( args, int64_t );
break;
/* Modified control */
case ES_OUT_SET_ES: /* arg1= es_out_id_t* */
......@@ -1569,6 +1573,9 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
return es_out_Control( p_out, i_query, p_cmd->u.control.u.int_epg_evt.i_int,
p_cmd->u.control.u.int_epg_evt.p_evt );
case ES_OUT_SET_EPG_TIME: /* arg1=int64_t */
return es_out_Control( p_out, i_query, p_cmd->u.control.u.i_i64 );
case ES_OUT_SET_ES_SCRAMBLED_STATE: /* arg1=int es_out_id_t* arg2=bool */
return es_out_Control( p_out, i_query, p_cmd->u.control.u.es_bool.p_es->p_es,
p_cmd->u.control.u.es_bool.b_bool );
......
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