[vlc-devel] commit: macosx: Cache the input state and properly ask the ugly timer to sync with it. ( Pierre d'Herbemont )

git version control git at videolan.org
Sun Aug 10 00:15:26 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Aug 10 00:17:59 2008 +0200| [658039e15115ca10adb8695678c681739b41b212] | committer: Pierre d'Herbemont 

macosx: Cache the input state and properly ask the ugly timer to sync with it.

Should fix #1836 (OSX "waiting" progressbar sometimes doesn't restore to normal state when file starts)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=658039e15115ca10adb8695678c681739b41b212
---

 modules/gui/macosx/intf.h |    2 ++
 modules/gui/macosx/intf.m |   13 +++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index 7c6cf98..880f473 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -304,6 +304,8 @@ struct intf_sys_t
 
     int     i_lastShownVolume;
 
+    input_state_e cachedInputState;
+
     /* the manage thread */
     pthread_t manage_thread;
 
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index a541ba5..aceca40 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -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;
             }




More information about the vlc-devel mailing list