Commit 6cc64e52 authored by Thomas Guillem's avatar Thomas Guillem

input: change seek/volume in ControlNav()

Change seek/volume only if the input is not a menu or if the input can't change
viewpoint.
parent 0c788078
......@@ -1779,18 +1779,24 @@ static void ControlNav( input_thread_t *p_input, int i_type )
/* Handle Up/Down/Left/Right if the demux can't navigate */
vlc_viewpoint_t vp = {};
int vol_direction = 0;
int seek_direction = 0;
switch( i_type )
{
case INPUT_CONTROL_NAV_UP:
vol_direction = 1;
vp.pitch = -1.f;
break;
case INPUT_CONTROL_NAV_DOWN:
vol_direction = -1;
vp.pitch = 1.f;
break;
case INPUT_CONTROL_NAV_LEFT:
seek_direction = -1;
vp.yaw = -1.f;
break;
case INPUT_CONTROL_NAV_RIGHT:
seek_direction = 1;
vp.yaw = 1.f;
break;
case INPUT_CONTROL_NAV_ACTIVATE:
......@@ -1825,6 +1831,23 @@ static void ControlNav( input_thread_t *p_input, int i_type )
ViewpointApply( p_input );
return;
}
/* Seek or change volume if the input doesn't have navigation or viewpoint */
if( seek_direction != 0 )
{
mtime_t it = var_InheritInteger( p_input, "short-jump-size" );
var_SetInteger( p_input, "time-offset", it * seek_direction * CLOCK_FREQ );
}
else
{
assert( vol_direction != 0 );
audio_output_t *p_aout = input_resource_HoldAout( priv->p_resource );
if( p_aout )
{
aout_VolumeUpdate( p_aout, vol_direction, NULL );
vlc_object_release( p_aout );
}
}
}
static bool Control( input_thread_t *p_input,
......
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