-
-#include "input.h"
-
-/*****************************************************************************
- * input_SetStatus: change the reading status
- *****************************************************************************/
-void input_SetStatus( input_thread_t * p_input, int i_mode )
-{
- vlc_mutex_lock( &p_input->stream.stream_lock );
-
- switch( i_mode )
- {
- case INPUT_STATUS_END:
- p_input->stream.i_new_status = PLAYING_S;
- p_input->b_eof = 1;
- intf_Msg( "input: end of stream" );
- break;
-
- case INPUT_STATUS_PLAY:
- p_input->stream.i_new_status = PLAYING_S;
- intf_Msg( "input: playing at normal rate" );
- break;
-
- case INPUT_STATUS_PAUSE:
- /* XXX: we don't need to check i_status, because input_clock.c
- * does it for us */
- p_input->stream.i_new_status = PAUSE_S;
- intf_Msg( "input: toggling pause" );
- break;
-
- case INPUT_STATUS_FASTER:
- /* If we are already going too fast, go back to default rate */
- if( p_input->stream.control.i_rate * 8 <= DEFAULT_RATE )
- {
- p_input->stream.i_new_status = PLAYING_S;
- intf_Msg( "input: playing at normal rate" );
- }
- else
- {
- p_input->stream.i_new_status = FORWARD_S;
-
- if( p_input->stream.control.i_rate < DEFAULT_RATE
- && p_input->stream.control.i_status == FORWARD_S )
- {
- p_input->stream.i_new_rate =
- p_input->stream.control.i_rate / 2;
- }
- else
- {
- p_input->stream.i_new_rate = DEFAULT_RATE / 2;
- }
- intf_Msg( "input: playing at %i:1 fast forward",
- DEFAULT_RATE / p_input->stream.i_new_rate );
- }
- break;
-
- case INPUT_STATUS_SLOWER:
- /* If we are already going too slow, go back to default rate */
- if( p_input->stream.control.i_rate >= 8 * DEFAULT_RATE )
- {
- p_input->stream.i_new_status = PLAYING_S;
- intf_Msg( "input: playing at normal rate" );
- }
- else
- {
- p_input->stream.i_new_status = FORWARD_S;
-
- if( p_input->stream.control.i_rate > DEFAULT_RATE
- && p_input->stream.control.i_status == FORWARD_S )
- {
- p_input->stream.i_new_rate =
- p_input->stream.control.i_rate * 2;
- }
- else
- {
- p_input->stream.i_new_rate = DEFAULT_RATE * 2;
- }
- intf_Msg( "input: playing at 1:%i slow motion",
- p_input->stream.i_new_rate / DEFAULT_RATE );
- }
- break;
-
- default:
- }
-
- vlc_cond_signal( &p_input->stream.stream_wait );
- vlc_mutex_unlock( &p_input->stream.stream_lock );
-}
-
-/*****************************************************************************
- * input_SetRate: change the reading rate
- *****************************************************************************/
-void input_SetRate( input_thread_t * p_input, int i_mode )
-{
- ; /* FIXME: stub */
-}
-
-/*****************************************************************************
- * input_Seek: changes the stream postion
- *****************************************************************************/
-void input_Seek( input_thread_t * p_input, off_t i_position )
-{
- char psz_time1[OFFSETTOTIME_MAX_SIZE];
- char psz_time2[OFFSETTOTIME_MAX_SIZE];
-
- vlc_mutex_lock( &p_input->stream.stream_lock );
- p_input->stream.p_selected_area->i_seek = i_position;
-
- intf_Msg( "input: seeking position %lld/%lld (%s/%s)", i_position,
- p_input->stream.p_selected_area->i_size,
- input_OffsetToTime( p_input, psz_time1, i_position ),
- input_OffsetToTime( p_input, psz_time2,
- p_input->stream.p_selected_area->i_size ) );
-
- vlc_cond_signal( &p_input->stream.stream_wait );
- vlc_mutex_unlock( &p_input->stream.stream_lock );
-}