]> git.sesse.net Git - vlc/commitdiff
*Don't keep the control lock during the pause
authorStéphane Borel <stef@videolan.org>
Fri, 17 May 2002 18:06:34 +0000 (18:06 +0000)
committerStéphane Borel <stef@videolan.org>
Fri, 17 May 2002 18:06:34 +0000 (18:06 +0000)
src/input/input_clock.c

index 3479311c4d7827f0ae16b0a0bbeef1a2028ea816..63e82faea8079c28f7aa658e727cbf2cea26ed3b 100644 (file)
@@ -2,7 +2,7 @@
  * input_clock.c: Clock/System date convertions, stream management
  *****************************************************************************
  * 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>
  *
@@ -155,10 +155,12 @@ int input_ClockManageControl( input_thread_t * p_input,
     if( p_input->stream.i_new_status == PAUSE_S )
     {
         int i_old_status;
+
         vlc_mutex_lock( &p_input->stream.control.control_lock );
         i_old_status = p_input->stream.control.i_status;
-
         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,
                        &p_input->stream.stream_lock );
         p_pgrm->last_syscr = 0;
@@ -167,13 +169,15 @@ int input_ClockManageControl( input_thread_t * p_input,
         if( p_input->stream.i_new_status == PAUSE_S )
         { 
             /* 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;
+            vlc_mutex_unlock( &p_input->stream.control.control_lock );
+            
             p_input->stream.i_new_status = UNDEF_S;
             p_input->stream.i_new_rate = UNDEF_S;
         }
 
         /* We handle i_new_status != PAUSE_S below... */
-        vlc_mutex_unlock( &p_input->stream.control.control_lock );
 
         i_return_value = PAUSE_S;
     }