[vlc-commits] commit: ncurses: rearrange Run() to remove a variable ( Rafaël Carré )

git at videolan.org git at videolan.org
Wed Oct 27 12:45:36 CEST 2010


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Wed Oct 27 01:26:39 2010 +0200| [e9976acac5580d150fef62d4ae677b36c147ba86] | committer: Rafaël Carré 

ncurses: rearrange Run() to remove a variable

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

 modules/gui/ncurses.c |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)

diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 035dfb6..b1e5e83 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -1869,12 +1869,10 @@ static void Run(intf_thread_t *p_intf)
 {
     intf_sys_t    *p_sys = p_intf->p_sys;
     playlist_t    *p_playlist = pl_Get(p_intf);
-    bool           force_redraw = false;
 
     time_t t_last_refresh;
     int canc = vlc_savecancel();
 
-    PlaylistRebuild(p_intf);
     Redraw(p_intf, &t_last_refresh);
 
     var_AddCallback(p_playlist, "intf-change", PlaylistChanged, p_intf);
@@ -1884,11 +1882,17 @@ static void Run(intf_thread_t *p_intf)
     {
         msleep(INTF_IDLE_SLEEP);
 
-        /* Update the input */
+        PL_LOCK;
+        if (p_sys->b_box_plidx_follow && playlist_CurrentPlayingItem(p_playlist))
+            FindIndex(p_sys, p_playlist, true);
+
+        PL_UNLOCK;
+
         if (!p_sys->p_input)
         {
             p_sys->p_input = playlist_CurrentInput(p_playlist);
-            force_redraw = true;
+            if (p_sys->p_input)
+                Redraw(p_intf, &t_last_refresh);
         }
         else if (p_sys->p_input->b_dead)
         {
@@ -1896,22 +1900,10 @@ static void Run(intf_thread_t *p_intf)
             p_sys->p_input = NULL;
         }
 
-        PL_LOCK;
-        if (p_sys->b_box_plidx_follow && playlist_CurrentPlayingItem(p_playlist))
-            FindIndex(p_sys, p_playlist, true);
-
-        PL_UNLOCK;
-
         while (HandleKey(p_intf))
             Redraw(p_intf, &t_last_refresh);
 
-        if (force_redraw)
-        {
-            clear();
-            Redraw(p_intf, &t_last_refresh);
-            force_redraw = false;
-        }
-        else if ((time(0) - t_last_refresh) >= 1)
+        if ((time(0) - t_last_refresh) >= 1)
             Redraw(p_intf, &t_last_refresh);
     }
     var_DelCallback(p_playlist, "intf-change", PlaylistChanged, p_intf);



More information about the vlc-commits mailing list