[MPlayer-cvslog] r34140 - in trunk: gui/interface.c gui/interface.h gui/win32/interface.c mplayer.c

ib subversion at mplayerhq.hu
Tue Sep 27 16:15:43 CEST 2011


Author: ib
Date: Tue Sep 27 16:15:42 2011
New Revision: 34140

Log:
Remove gui() instruction GUI_SET_FILE.

Move the preparation part to GUI_PREPARE and the part
resetting variable guiInfo.sh_video to GUI_END_FILE.

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/win32/interface.c
   trunk/mplayer.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Mon Sep 26 19:25:45 2011	(r34139)
+++ trunk/gui/interface.c	Tue Sep 27 16:15:42 2011	(r34140)
@@ -344,26 +344,6 @@ int gui(int what, void *data)
         uiState();
         break;
 
-    case GUI_SET_FILE:
-
-// if ( guiInfo.Playing == 1 && guiInfo.NewPlay == GUI_FILE_NEW )
-        if (guiInfo.NewPlay == GUI_FILE_NEW) {
-            dvd_title = 0;
-            audio_id  = -1;
-            video_id  = -1;
-            dvdsub_id = -1;
-            vobsub_id = -1;
-
-            stream_cache_size = -1;
-            autosync  = 0;
-            force_fps = 0;
-        }
-
-        guiInfo.sh_video = NULL;
-        wsPostRedisplay(&guiApp.subWindow);
-
-        break;
-
     case GUI_HANDLE_EVENTS:
         if (!guiInfo.Playing || !guiInfo.VideoWindow)
             wsHandleEvents();
@@ -400,10 +380,20 @@ int gui(int what, void *data)
 
     case GUI_PREPARE:
 
-        gui(GUI_SET_FILE, 0);
-
         wsVisibleMouse(&guiApp.subWindow, wsHideMouseCursor);
 
+        if (guiInfo.NewPlay == GUI_FILE_NEW) {
+            dvd_title = 0;
+            audio_id  = -1;
+            video_id  = -1;
+            dvdsub_id = -1;
+            vobsub_id = -1;
+
+            stream_cache_size = -1;
+            autosync  = 0;
+            force_fps = 0;
+        }
+
         switch (guiInfo.StreamType) {
         case STREAMTYPE_PLAYLIST:
             break;
@@ -767,6 +757,8 @@ int gui(int what, void *data)
 
         uiEventHandling(evRedraw, 1);
 
+        guiInfo.sh_video = NULL;
+
         if (!uiGotoTheNext && guiInfo.Playing) {
             uiGotoTheNext = 1;
             break;

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Mon Sep 26 19:25:45 2011	(r34139)
+++ trunk/gui/interface.h	Tue Sep 27 16:15:42 2011	(r34140)
@@ -49,7 +49,6 @@ enum {
     GUI_SET_AFILTER,
     GUI_SET_AUDIO,
     GUI_SET_CONTEXT,
-    GUI_SET_FILE,
     GUI_SET_MIXER,
     GUI_SET_STATE,
     GUI_SET_STREAM,

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Mon Sep 26 19:25:45 2011	(r34139)
+++ trunk/gui/win32/interface.c	Tue Sep 27 16:15:42 2011	(r34140)
@@ -446,7 +446,28 @@ int gui(int what, void *data)
     {
         case GUI_PREPARE:
         {
-            gui(GUI_SET_FILE, 0);
+            audio_id = -1;
+            video_id = -1;
+            dvdsub_id = -1;
+            vobsub_id = -1;
+            stream_cache_size = -1;
+            autosync = 0;
+            dvd_title = 0;
+            force_fps = 0;
+            if(!mygui->playlist->tracks) return 0;
+            filename = guiInfo.Filename = mygui->playlist->tracks[mygui->playlist->current]->filename;
+            guiInfo.Track = mygui->playlist->current + 1;
+            if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm");
+            if(gtkAOExtraStereo)
+            {
+                char *name = malloc(12 + 20 + 1);
+                snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul);
+                name[12 + 20] = 0;
+                greplace(&af_cfg.list, "extrastereo", name);
+                free(name);
+            }
+            if(gtkCacheOn) stream_cache_size = gtkCacheSize;
+            if(gtkAutoSyncOn) autosync = gtkAutoSync;
             guiInfo.NewPlay = 0;
             switch(guiInfo.StreamType)
             {
@@ -594,32 +615,6 @@ int gui(int what, void *data)
             }
             break;
         }
-        case GUI_SET_FILE:
-        {
-            audio_id = -1;
-            video_id = -1;
-            dvdsub_id = -1;
-            vobsub_id = -1;
-            stream_cache_size = -1;
-            autosync = 0;
-            dvd_title = 0;
-            force_fps = 0;
-            if(!mygui->playlist->tracks) return 0;
-            filename = guiInfo.Filename = mygui->playlist->tracks[mygui->playlist->current]->filename;
-            guiInfo.Track = mygui->playlist->current + 1;
-            if(gtkAONorm) greplace(&af_cfg.list, "volnorm", "volnorm");
-            if(gtkAOExtraStereo)
-            {
-                char *name = malloc(12 + 20 + 1);
-                snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul);
-                name[12 + 20] = 0;
-                greplace(&af_cfg.list, "extrastereo", name);
-                free(name);
-            }
-            if(gtkCacheOn) stream_cache_size = gtkCacheSize;
-            if(gtkAutoSyncOn) autosync = gtkAutoSync;
-            break;
-        }
         case GUI_HANDLE_EVENTS:
           break;
         case GUI_SET_MIXER:

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Mon Sep 26 19:25:45 2011	(r34139)
+++ trunk/mplayer.c	Tue Sep 27 16:15:42 2011	(r34140)
@@ -3042,7 +3042,6 @@ play_next_file:
 #ifdef CONFIG_GUI
     if (use_gui) {
         mpctx->file_format = DEMUXER_TYPE_UNKNOWN;
-        gui(GUI_SET_FILE, 0);
         while (guiInfo.Playing != GUI_PLAY) {
             mp_cmd_t *cmd;
             usec_sleep(20000);


More information about the MPlayer-cvslog mailing list