mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-28 23:09:59 +02:00
input: Allow track autoselection to be enabled/disabled
This commit is contained in:
parent
a114f8d667
commit
f800fd9ee7
@ -112,6 +112,10 @@ enum es_out_query_e
|
||||
ES_OUT_SPU_SET_HIGHLIGHT, /* arg1= es_out_id_t* (spu es),
|
||||
arg2= const vlc_spu_highlight_t *, res=can fail */
|
||||
|
||||
/* Disable autoselection of tracks from a given category */
|
||||
ES_OUT_SET_AUTOSELECT, /* arg1= int (es category),
|
||||
arg2= int (enabled/disabled), res=can fail */
|
||||
|
||||
/* First value usable for private control */
|
||||
ES_OUT_PRIVATE_START = 0x10000,
|
||||
};
|
||||
|
@ -3495,6 +3495,26 @@ static int EsOutVaControlLocked( es_out_t *out, int i_query, va_list args )
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
case ES_OUT_SET_AUTOSELECT:
|
||||
{
|
||||
int i_cat = va_arg( args, int );
|
||||
bool b_enabled = va_arg( args, int );
|
||||
switch ( i_cat )
|
||||
{
|
||||
case VIDEO_ES:
|
||||
p_sys->video.b_autoselect = b_enabled;
|
||||
break;
|
||||
case AUDIO_ES:
|
||||
p_sys->audio.b_autoselect = b_enabled;
|
||||
break;
|
||||
case SPU_ES:
|
||||
p_sys->sub.b_autoselect = b_enabled;
|
||||
break;
|
||||
default:
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
return VLC_SUCCESS;
|
||||
}
|
||||
default:
|
||||
msg_Err( p_sys->p_input, "unknown query 0x%x in %s", i_query,
|
||||
__func__ );
|
||||
|
@ -2277,6 +2277,10 @@ static bool Control( input_thread_t *p_input,
|
||||
param.vbi_transparency.id,
|
||||
param.vbi_transparency.enabled );
|
||||
break;
|
||||
case INPUT_CONTROL_SET_ES_AUTOSELECT:
|
||||
es_out_Control( priv->p_es_out_display, ES_OUT_SET_AUTOSELECT,
|
||||
param.es_autoselect.cat, param.es_autoselect.enabled );
|
||||
break;
|
||||
|
||||
case INPUT_CONTROL_NAV_ACTIVATE:
|
||||
case INPUT_CONTROL_NAV_UP:
|
||||
|
@ -435,6 +435,10 @@ typedef union
|
||||
vlc_es_id_t *id;
|
||||
bool enabled;
|
||||
} vbi_transparency;
|
||||
struct {
|
||||
enum es_format_category_e cat;
|
||||
bool enabled;
|
||||
} es_autoselect;
|
||||
} input_control_param_t;
|
||||
|
||||
typedef struct
|
||||
@ -586,6 +590,8 @@ enum input_control_e
|
||||
|
||||
INPUT_CONTROL_SET_VBI_PAGE,
|
||||
INPUT_CONTROL_SET_VBI_TRANSPARENCY,
|
||||
|
||||
INPUT_CONTROL_SET_ES_AUTOSELECT,
|
||||
};
|
||||
|
||||
/* Internal helpers */
|
||||
|
Loading…
Reference in New Issue
Block a user