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

ib subversion at mplayerhq.hu
Tue Jun 28 10:52:02 CEST 2011


Author: ib
Date: Tue Jun 28 10:52:02 2011
New Revision: 33749

Log:
Rename guiGetEvent type guiSetAudioOnly guiSetAudio.

(All audio related guiGetEvent() code will be moved here later.)

Additionally, set variable guiInfo.AudioChannels in guiGetEvent()
rather than in mplayer.c. In order to do this, guiSetVideo must come
first, then audio.

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	Tue Jun 28 09:31:35 2011	(r33748)
+++ trunk/gui/interface.c	Tue Jun 28 10:52:02 2011	(r33749)
@@ -591,11 +591,11 @@ int guiGetEvent(int type, void *arg)
             guiSetFilename(guiInfo.Filename, arg);
         break;
 
-    case guiSetAudioOnly:
+    case guiSetAudio:
 
-        guiInfo.AudioOnly = (int)arg;
+        guiInfo.AudioChannels = arg ? ((sh_audio_t *)arg)->channels : 0;
 
-        if (guiInfo.AudioOnly) {
+        if (!guiInfo.MovieWindow || (arg && !guiInfo.sh_video)) {
             guiInfo.MovieWindow = False;
             wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
         } else
@@ -715,9 +715,6 @@ int guiGetEvent(int type, void *arg)
             guiInfo.FPS = sh->fps;
         }
 
-        if (!guiInfo.MovieWindow)
-            wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
-
         if (guiInfo.StreamType == STREAMTYPE_STREAM)
             btnSet(evSetMoviePosition, btnDisabled);
         else

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Tue Jun 28 09:31:35 2011	(r33748)
+++ trunk/gui/interface.h	Tue Jun 28 10:52:02 2011	(r33749)
@@ -41,7 +41,7 @@ extern int use_gui;             // this 
 #define guiRunCommand      2
 #define guiSetDVD          3
 #define guiSetFileName     4
-#define guiSetAudioOnly    6
+#define guiSetAudio        6
 #define guiReDrawSubWindow 7
 #define guiSetVideoWindow  8
 #define guiSetStream       9
@@ -177,7 +177,6 @@ typedef struct {
     int Track;
     int AudioChannels;
     int StreamType;
-    int AudioOnly;
     int TimeSec;
     int LengthInSec;
     int FrameDrop;

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Tue Jun 28 09:31:35 2011	(r33748)
+++ trunk/gui/win32/interface.c	Tue Jun 28 10:52:02 2011	(r33749)
@@ -580,9 +580,11 @@ int guiGetEvent(int type, void *arg)
                 strcpy(guiInfo.Filename, filename);
             break;
         }
-        case guiSetAudioOnly:
+        case guiSetAudio:
         {
-            guiInfo.AudioOnly = (int) arg;
+            // NOTE: This type doesn't mean (and never meant) that we have
+            // *just* audio, so there probably should be a check before
+            // hiding (see gui/interface.c).
             if(IsWindowVisible(mygui->subwindow))
                 ShowWindow(mygui->subwindow, SW_HIDE);
             break;

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Tue Jun 28 09:31:35 2011	(r33748)
+++ trunk/mplayer.c	Tue Jun 28 10:52:02 2011	(r33749)
@@ -3677,10 +3677,9 @@ goto_enable_cache:
 
 #ifdef CONFIG_GUI
         if (use_gui) {
-            guiInfo.AudioChannels = mpctx->sh_audio ? mpctx->sh_audio->channels : 0;
-            guiGetEvent(guiSetAudioOnly, (void *)(mpctx->sh_audio && !mpctx->sh_video));
             if (guiGetEvent(guiSetVideo, mpctx->sh_video))
                 goto goto_next_file;
+            guiGetEvent(guiSetAudio, mpctx->sh_audio);
         }
 #endif
 


More information about the MPlayer-cvslog mailing list