Commit 90b1145a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

demux: merge single program into list

So far, DEMUX_SET_GROUP accepts four different prototypes of sorts:
*  0, dummy: select the default program
* -1, NULL:  select all progams
* -1, &list: select programs in list
*  i, dummy: select program i

This patch folds the last case into the third one: a single program is
a list one of program.
parent 2dc0f812
...@@ -1269,8 +1269,18 @@ static void InitPrograms( input_thread_t * p_input ) ...@@ -1269,8 +1269,18 @@ static void InitPrograms( input_thread_t * p_input )
} }
else else
{ {
demux_Control( input_priv(p_input)->master->p_demux, DEMUX_SET_GROUP, int program = es_out_GetGroupForced( input_priv(p_input)->p_es_out );
es_out_GetGroupForced( input_priv(p_input)->p_es_out ), NULL ); if( program == 0 )
demux_Control( input_priv(p_input)->master->p_demux,
DEMUX_SET_GROUP, 0, NULL );
else
{
vlc_value_t val = { .i_int = program };
list.i_count = 1, list.p_values = &val;
demux_Control( input_priv(p_input)->master->p_demux,
DEMUX_SET_GROUP, -1, &list );
}
} }
} }
...@@ -2015,8 +2025,16 @@ static bool Control( input_thread_t *p_input, ...@@ -2015,8 +2025,16 @@ static bool Control( input_thread_t *p_input,
es_out_Control( input_priv(p_input)->p_es_out, es_out_Control( input_priv(p_input)->p_es_out,
ES_OUT_SET_GROUP, val.i_int ); ES_OUT_SET_GROUP, val.i_int );
demux_Control( input_priv(p_input)->master->p_demux, DEMUX_SET_GROUP, val.i_int, if( val.i_int == 0 )
NULL ); demux_Control( input_priv(p_input)->master->p_demux,
DEMUX_SET_GROUP, 0, NULL );
else
{
vlc_list_t list = { .i_count = 1, list.p_values = &val };
demux_Control( input_priv(p_input)->master->p_demux,
DEMUX_SET_GROUP, -1, &list );
}
break; break;
case INPUT_CONTROL_SET_ES: case INPUT_CONTROL_SET_ES:
......
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