]> git.sesse.net Git - vlc/commitdiff
macosx: Cache the input state and properly ask the ugly timer to sync with it.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 9 Aug 2008 22:17:59 +0000 (00:17 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 9 Aug 2008 22:17:59 +0000 (00:17 +0200)
Should fix #1836 (OSX "waiting" progressbar sometimes doesn't restore to normal state when file starts)

modules/gui/macosx/intf.h
modules/gui/macosx/intf.m

index 7c6cf98eaf3030bb5defb74610999abef8b8cd64..880f4730c9d624ef7ae397897fec4e10034c3246 100644 (file)
@@ -304,6 +304,8 @@ struct intf_sys_t
 
     int     i_lastShownVolume;
 
+    input_state_e cachedInputState;
+
     /* the manage thread */
     pthread_t manage_thread;
 
index a541ba5392f87336ca3cd073c4d78ebb74bf9f12..aceca40b25cdb40a1c159482f3546a99f9baaaea 100644 (file)
@@ -1221,6 +1221,7 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
     pl_Release( p_intf );
 
     vlc_object_lock( p_intf );
+
     while( vlc_object_alive( p_intf ) )
     {
         vlc_mutex_lock( &p_intf->change_lock );
@@ -1245,6 +1246,10 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
             vlc_object_release( p_input );
             p_input = NULL;
         }
+        else if( cachedInputState != input_GetState( p_input ) )
+        {
+            p_intf->p_sys->b_intf_update = true;
+        }
 
         /* Manage volume status */
         [self manageVolumeSlider];
@@ -1304,10 +1309,10 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
         if( ( b_input = ( p_input != NULL ) ) )
         {
             /* seekable streams */
-            int state = input_GetState( p_input );
-            if ( state == INIT_S ||
-                 state == OPENING_S ||
-                 state == BUFFERING_S )
+            cachedInputState = input_GetState( p_input );
+            if ( cachedInputState == INIT_S ||
+                 cachedInputState == OPENING_S ||
+                 cachedInputState == BUFFERING_S )
             {
                 b_buffering = YES;
             }