Commit 8c510fef authored by Christophe Mutricy's avatar Christophe Mutricy

Revert "Signal can_rewind for use by user interfaces."

This reverts commit 61a2101b.

New features that are not self-contained and modify src/ are not
welcomed in -bugfix branches without pre-existent consensus.
parent 64e2fdc4
...@@ -922,24 +922,16 @@ void libvlc_media_player_set_rate( ...@@ -922,24 +922,16 @@ void libvlc_media_player_set_rate(
{ {
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
vlc_value_t val; vlc_value_t val;
bool b_can_rewind;
if( rate != 0 ) if( rate <= 0 )
RAISEVOID( "Rate value is invalid" ); RAISEVOID( "Rate value is invalid" );
p_input_thread = libvlc_get_input_thread ( p_mi, p_e); val.i_int = 1000.0f/rate;
if( !p_input_thread )
return;
b_can_rewind = var_GetBool( p_input_thread, "can-rewind" ); p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
if( (rate < 0) && !b_can_rewind ) if ( !p_input_thread )
{
vlc_object_release( p_input_thread );
libvlc_exception_raise( p_e, "Rate value is invalid" );
return; return;
}
val.i_int = 1000.0f/rate;
var_Set( p_input_thread, "rate", val ); var_Set( p_input_thread, "rate", val );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
} }
...@@ -950,19 +942,12 @@ float libvlc_media_player_get_rate( ...@@ -950,19 +942,12 @@ float libvlc_media_player_get_rate(
{ {
input_thread_t *p_input_thread; input_thread_t *p_input_thread;
vlc_value_t val; vlc_value_t val;
bool b_can_rewind;
p_input_thread = libvlc_get_input_thread ( p_mi, p_e ); p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
if( !p_input_thread ) if ( !p_input_thread )
return 0.0; /* rate < 0 indicates rewind */ return -1.0;
var_Get( p_input_thread, "rate", &val ); var_Get( p_input_thread, "rate", &val );
b_can_rewind = var_GetBool( p_input_thread, "can-rewind" );
if( (val.i_int < 0) && !b_can_rewind )
{
libvlc_exception_raise( p_e, "invalid rate" );
return 0.0;
}
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
return (float)1000.0f/val.i_int; return (float)1000.0f/val.i_int;
......
...@@ -1628,7 +1628,6 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1628,7 +1628,6 @@ static bool Control( input_thread_t *p_input, int i_type,
i_error = i_test_e; i_error = i_test_e;
} }
} }
assert( i_idx >= 0 && ppi_factor[i_idx][0] != 0 ); assert( i_idx >= 0 && ppi_factor[i_idx][0] != 0 );
if( i_type == INPUT_CONTROL_SET_RATE_SLOWER ) if( i_type == INPUT_CONTROL_SET_RATE_SLOWER )
...@@ -2180,7 +2179,6 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2180,7 +2179,6 @@ static int InputSourceInit( input_thread_t *p_input,
&in->b_can_pause ) ) &in->b_can_pause ) )
in->b_can_pause = false; in->b_can_pause = false;
var_SetBool( p_input, "can-pause", in->b_can_pause ); var_SetBool( p_input, "can-pause", in->b_can_pause );
var_SetBool( p_input, "can-rewind", !in->b_rescale_ts );
int ret = demux_Control( in->p_demux, DEMUX_CAN_SEEK, int ret = demux_Control( in->p_demux, DEMUX_CAN_SEEK,
&val.b_bool ); &val.b_bool );
...@@ -2265,10 +2263,7 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2265,10 +2263,7 @@ static int InputSourceInit( input_thread_t *p_input,
access_Control( in->p_access, ACCESS_CAN_PAUSE, access_Control( in->p_access, ACCESS_CAN_PAUSE,
&in->b_can_pause ); &in->b_can_pause );
var_SetBool( p_input, "can-pause", in->b_can_pause ); var_SetBool( p_input, "can-pause", in->b_can_pause );
var_SetBool( p_input, "can-rewind", !in->b_rescale_ts );
access_Control( in->p_access, ACCESS_CAN_SEEK, access_Control( in->p_access, ACCESS_CAN_SEEK,
&val.b_bool ); &val.b_bool );
var_Set( p_input, "seekable", val ); var_Set( p_input, "seekable", val );
......
...@@ -66,7 +66,6 @@ typedef struct ...@@ -66,7 +66,6 @@ typedef struct
const char *psz_name; const char *psz_name;
vlc_callback_t callback; vlc_callback_t callback;
} vlc_input_callback_t; } vlc_input_callback_t;
static void InputAddCallbacks( input_thread_t *, const vlc_input_callback_t * ); static void InputAddCallbacks( input_thread_t *, const vlc_input_callback_t * );
static void InputDelCallbacks( input_thread_t *, const vlc_input_callback_t * ); static void InputDelCallbacks( input_thread_t *, const vlc_input_callback_t * );
...@@ -472,11 +471,6 @@ void input_ConfigVarInit ( input_thread_t *p_input ) ...@@ -472,11 +471,6 @@ void input_ConfigVarInit ( input_thread_t *p_input )
var_Create( p_input, "can-pause", VLC_VAR_BOOL ); var_Create( p_input, "can-pause", VLC_VAR_BOOL );
val.b_bool = true; /* Fixed later*/ val.b_bool = true; /* Fixed later*/
var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL ); var_Change( p_input, "can-pause", VLC_VAR_SETVALUE, &val, NULL );
var_Create( p_input, "can-rewind", VLC_VAR_BOOL );
val.b_bool = false;
var_Change( p_input, "can-rewind", VLC_VAR_SETVALUE, &val, NULL );
var_Create( p_input, "teletext-es", VLC_VAR_INTEGER ); var_Create( p_input, "teletext-es", VLC_VAR_INTEGER );
var_SetInteger( p_input, "teletext-es", -1 ); var_SetInteger( p_input, "teletext-es", -1 );
...@@ -508,7 +502,6 @@ static void InputAddCallbacks( input_thread_t *p_input, ...@@ -508,7 +502,6 @@ static void InputAddCallbacks( input_thread_t *p_input,
p_callbacks[i].psz_name, p_callbacks[i].psz_name,
p_callbacks[i].callback, NULL ); p_callbacks[i].callback, NULL );
} }
static void InputDelCallbacks( input_thread_t *p_input, static void InputDelCallbacks( input_thread_t *p_input,
const vlc_input_callback_t *p_callbacks ) const vlc_input_callback_t *p_callbacks )
{ {
...@@ -518,7 +511,6 @@ static void InputDelCallbacks( input_thread_t *p_input, ...@@ -518,7 +511,6 @@ static void InputDelCallbacks( input_thread_t *p_input,
p_callbacks[i].psz_name, p_callbacks[i].psz_name,
p_callbacks[i].callback, NULL ); p_callbacks[i].callback, NULL );
} }
/***************************************************************************** /*****************************************************************************
* All Callbacks: * All Callbacks:
*****************************************************************************/ *****************************************************************************/
...@@ -557,6 +549,7 @@ static int RateCallback( vlc_object_t *p_this, char const *psz_cmd, ...@@ -557,6 +549,7 @@ static int RateCallback( vlc_object_t *p_this, char const *psz_cmd,
{ {
input_ControlPush( p_input, INPUT_CONTROL_SET_RATE, &newval ); input_ControlPush( p_input, INPUT_CONTROL_SET_RATE, &newval );
} }
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
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