diff gui/mplayer/play.c @ 32893:c873777e957d

Get rid of needless listItems variable and pointer. The tmpList structure variable was only used to check whether a skin can be read without error. After the check tmpList was erased and the same skin read once again into another structure - the appropriate target structure. Now error checking is done with skin reading into the target structure. The separate skinAppMPlayer pointer was needless, because a skin will only be read into the one global listItems structure appMPlayer, so that its address can be used right away. Freeing the listItems was done twice before and is now performed at a single place, where the fonts are freed now as well - in skinRead() right before skin reading starts. As a result there is now only one listItems variable - the global appMPlayer; memory is saved, passing around global variables and pointless double actions are avoided.
author ib
date Sun, 27 Feb 2011 17:41:05 +0000
parents bd3ea059fe2d
children f01aafc5a961
line wrap: on
line diff
--- a/gui/mplayer/play.c	Sun Feb 27 15:25:20 2011 +0000
+++ b/gui/mplayer/play.c	Sun Feb 27 17:41:05 2011 +0000
@@ -194,32 +194,20 @@
     abs_seek_pos  = 3;
 }
 
-listItems tmpList;
-
 void ChangeSkin(char *name)
 {
-    int prev, bprev, ret;
+    int prev, bprev;
 
     prev  = appMPlayer.menuIsPresent;
     bprev = appMPlayer.barIsPresent;
 
     mainVisible = 0;
 
-    appInitStruct(&tmpList);
-    skinAppMPlayer = &tmpList;
-    fntFreeFont();
-    ret = skinRead(name);
-
-    appInitStruct(&tmpList);
-    skinAppMPlayer = &appMPlayer;
-    appInitStruct(&appMPlayer);
-
-    if (ret)
-        name = skinName;
-
-    if (skinRead(name)) {
+    if (skinRead(name) != 0) {
+        if (skinRead(skinName) != 0) {
         mainVisible = 1;
         return;
+        }
     }
 
     // reload menu window