Commit 5deaed2b authored by Stéphane Borel's avatar Stéphane Borel
Browse files

*Don't keep the control lock during the pause

parent a7e097b4
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management * input_clock.c: Clock/System date convertions, stream management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_clock.c,v 1.30 2002/05/14 21:23:44 massiot Exp $ * $Id: input_clock.c,v 1.31 2002/05/17 18:06:34 stef Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -155,10 +155,12 @@ int input_ClockManageControl( input_thread_t * p_input, ...@@ -155,10 +155,12 @@ int input_ClockManageControl( input_thread_t * p_input,
if( p_input->stream.i_new_status == PAUSE_S ) if( p_input->stream.i_new_status == PAUSE_S )
{ {
int i_old_status; int i_old_status;
vlc_mutex_lock( &p_input->stream.control.control_lock ); vlc_mutex_lock( &p_input->stream.control.control_lock );
i_old_status = p_input->stream.control.i_status; i_old_status = p_input->stream.control.i_status;
p_input->stream.control.i_status = PAUSE_S; p_input->stream.control.i_status = PAUSE_S;
vlc_mutex_unlock( &p_input->stream.control.control_lock );
vlc_cond_wait( &p_input->stream.stream_wait, vlc_cond_wait( &p_input->stream.stream_wait,
&p_input->stream.stream_lock ); &p_input->stream.stream_lock );
p_pgrm->last_syscr = 0; p_pgrm->last_syscr = 0;
...@@ -167,13 +169,15 @@ int input_ClockManageControl( input_thread_t * p_input, ...@@ -167,13 +169,15 @@ int input_ClockManageControl( input_thread_t * p_input,
if( p_input->stream.i_new_status == PAUSE_S ) if( p_input->stream.i_new_status == PAUSE_S )
{ {
/* PAUSE_S undoes the pause state: Return to old state. */ /* PAUSE_S undoes the pause state: Return to old state. */
vlc_mutex_lock( &p_input->stream.control.control_lock );
p_input->stream.control.i_status = i_old_status; p_input->stream.control.i_status = i_old_status;
vlc_mutex_unlock( &p_input->stream.control.control_lock );
p_input->stream.i_new_status = UNDEF_S; p_input->stream.i_new_status = UNDEF_S;
p_input->stream.i_new_rate = UNDEF_S; p_input->stream.i_new_rate = UNDEF_S;
} }
/* We handle i_new_status != PAUSE_S below... */ /* We handle i_new_status != PAUSE_S below... */
vlc_mutex_unlock( &p_input->stream.control.control_lock );
i_return_value = PAUSE_S; i_return_value = PAUSE_S;
} }
......
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