[MPlayer-cvslog] r33170 - trunk/gui/skin/skin.c

ib subversion at mplayerhq.hu
Thu Mar 31 14:03:54 CEST 2011


Author: ib
Date: Thu Mar 31 14:03:54 2011
New Revision: 33170

Log:
Clean up cmd_window().

Assign currWinName only after it has been checked.
Compare window name in full.
Add currWinItemIdx and currWinItems assignments for sub windows.

Modified:
   trunk/gui/skin/skin.c

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Thu Mar 31 13:38:30 2011	(r33169)
+++ trunk/gui/skin/skin.c	Thu Mar 31 14:03:54 2011	(r33170)
@@ -179,19 +179,21 @@ static int cmd_window(char *in)
         return 1;
     }
 
-    av_strlcpy(currWinName, strlower(in), sizeof(currWinName));
+    strlower(in);
 
-    if (!strncmp(in, "main", 4)) {
+    if (strcmp(in, "main") == 0) {
         currWin = &appMPlayer.main;
         currWinItemIdx = &appMPlayer.IndexOfMainItems;
         currWinItems   = appMPlayer.mainItems;
-    } else if (!strncmp(in, "sub", 3))
+    } else if (strcmp(in, "sub") == 0) {
         currWin = &appMPlayer.sub;
-    else if (!strncmp(in, "playbar", 7)) {
+        currWinItemIdx = NULL;
+        currWinItems   = NULL;
+    } else if (strcmp(in, "playbar") == 0) {
         currWin = &appMPlayer.bar;
         currWinItemIdx = &appMPlayer.IndexOfBarItems;
         currWinItems   = appMPlayer.barItems;
-    } else if (!strncmp(in, "menu", 4)) {
+    } else if (strcmp(in, "menu") == 0) {
         currWin = &appMPlayer.menuBase;
         currWinItemIdx = &appMPlayer.IndexOfMenuItems;
         currWinItems   = appMPlayer.menuItems;
@@ -200,6 +202,8 @@ static int cmd_window(char *in)
         return 1;
     }
 
+    av_strlcpy(currWinName, in, sizeof(currWinName));
+
     mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]   window: %s\n", currWinName);
 
     return 0;


More information about the MPlayer-cvslog mailing list