]> git.sesse.net Git - vlc/blobdiff - plugins/gtk/gtk_control.c
* Fixed the BeOS compile typo.
[vlc] / plugins / gtk / gtk_control.c
index 424bd28fb5926fe42a3ef917f16e36b0224aee56..7f6781f7b771bbab754f46203f6cb618f9706336 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_control.c : functions to handle stream control buttons.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_control.c,v 1.1 2001/05/15 01:01:44 stef Exp $
+ * $Id: gtk_control.c,v 1.4 2001/05/30 17:03:12 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -22,9 +22,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
@@ -56,6 +53,8 @@
 
 #include "main.h"
 
+#include "modules_export.h"
+
 /****************************************************************************
  * Control functions: this is where the functions are defined
  ****************************************************************************
@@ -83,12 +82,12 @@ gboolean GtkControlStop( GtkWidget       *widget,
         p_intf->p_input->b_eof = 1;
 
         /* update playlist */
-//        vlc_mutex_lock( &p_main->p_playlist->change_lock );
+        vlc_mutex_lock( &p_main->p_playlist->change_lock );
 
         p_main->p_playlist->i_index--;
         p_main->p_playlist->b_stopped = 1;
 
-//        vlc_mutex_unlock( &p_main->p_playlist->change_lock );
+        vlc_mutex_unlock( &p_main->p_playlist->change_lock );
 
     }
 
@@ -109,23 +108,28 @@ gboolean GtkControlPlay( GtkWidget       *widget,
     }
     else
     {
-//        vlc_mutex_lock( &p_main->p_playlist->change_lock );
+        vlc_mutex_lock( &p_main->p_playlist->change_lock );
 
         if( p_main->p_playlist->b_stopped )
         {
             if( p_main->p_playlist->i_size )
             {
+                vlc_mutex_unlock( &p_main->p_playlist->change_lock );
                 intf_PlaylistJumpto( p_main->p_playlist,
                                      p_main->p_playlist->i_index );
-                p_main->p_playlist->b_stopped = 0;
             }
             else
             {
+                vlc_mutex_unlock( &p_main->p_playlist->change_lock );
                 GtkFileOpenShow( widget, event, user_data );
             }
         }
+        else
+        {
+
+            vlc_mutex_unlock( &p_main->p_playlist->change_lock );
+        }
 
-//        vlc_mutex_unlock( &p_main->p_playlist->change_lock );
     }
 
     return TRUE;
@@ -141,7 +145,10 @@ gboolean GtkControlPause( GtkWidget       *widget,
     if( p_intf->p_input != NULL )
     {
         input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
+
+        vlc_mutex_lock( &p_main->p_playlist->change_lock );
         p_main->p_playlist->b_stopped = 0;
+        vlc_mutex_unlock( &p_main->p_playlist->change_lock );
     }
 
     return TRUE;
@@ -157,7 +164,10 @@ gboolean GtkControlSlow( GtkWidget       *widget,
     if( p_intf->p_input != NULL )
     {
         input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
+
+        vlc_mutex_lock( &p_main->p_playlist->change_lock );
         p_main->p_playlist->b_stopped = 0;
+        vlc_mutex_unlock( &p_main->p_playlist->change_lock );
     }
 
     return TRUE;
@@ -173,7 +183,10 @@ gboolean GtkControlFast( GtkWidget       *widget,
     if( p_intf->p_input != NULL )
     {
         input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
+
+        vlc_mutex_lock( &p_main->p_playlist->change_lock );
         p_main->p_playlist->b_stopped = 0;
+        vlc_mutex_unlock( &p_main->p_playlist->change_lock );
     }
 
     return TRUE;