Commit 40c292e6 authored by Renaud Dartus's avatar Renaud Dartus

We can now choose the speed of forward (between 32/1 and 1/8)

Thanks to Meuuh, he's MORTEL ;)
parent d7eae1f5
......@@ -28,3 +28,5 @@ typedef struct stream_ctrl_s
#define START_S 11
#define DEFAULT_RATE 1000
#define MINIMAL_RATE 31 /* Up to 32/1 */
#define MAXIMAL_RATE 8000 /* Up to 1/8 */
......@@ -2,7 +2,7 @@
* intf_sdl.c: SDL interface plugin
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_sdl.c,v 1.27 2001/02/07 17:44:52 massiot Exp $
* $Id: intf_sdl.c,v 1.28 2001/02/08 00:46:12 reno Exp $
*
* Authors:
*
......@@ -110,6 +110,7 @@ void intf_SDLManage( intf_thread_t *p_intf )
{
SDL_Event event; /* SDL event */
Uint8 i_key;
int i_rate;
while ( SDL_PollEvent(&event) )
{
......@@ -148,11 +149,20 @@ void intf_SDLManage( intf_thread_t *p_intf )
break;
case SDLK_a:
input_Forward( p_intf->p_input, DEFAULT_RATE/2 );
i_rate = p_intf->p_input->stream.control.i_rate;
if ( i_rate/2 >= MINIMAL_RATE )
input_Forward( p_intf->p_input, i_rate/2 );
break;
case SDLK_s:
input_Forward( p_intf->p_input, DEFAULT_RATE*2 );
i_rate = p_intf->p_input->stream.control.i_rate;
if ( i_rate*2 <= MAXIMAL_RATE )
{
/* Compensation of int truncature */
if ( i_rate*2 > 500 && i_rate*2 < 1000 )
i_rate = 1000/2;
input_Forward( p_intf->p_input, i_rate*2 );
}
break;
default:
......
......@@ -56,7 +56,10 @@ void input_Play( input_thread_t * p_input )
*****************************************************************************/
void input_Forward( input_thread_t * p_input, int i_rate )
{
intf_Msg( "Forward enabled" );
if ( i_rate > 1000 )
intf_Msg( "Forward enabled at 1/%d",i_rate/1000 );
else
intf_Msg( "Forward enabled at %d/1",1000/i_rate );
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_new_status = FORWARD_S;
p_input->stream.i_new_rate = i_rate;
......
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