changeset 33650:4af19d03b4e8

Simplify code concerning guiGetEvent type guiSetAudioOnly.
author ib
date Mon, 27 Jun 2011 10:46:25 +0000
parents 0f08a24d8109
children ede9413501da
files gui/interface.c mplayer.c
diffstat 2 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Mon Jun 27 10:35:25 2011 +0000
+++ b/gui/interface.c	Mon Jun 27 10:46:25 2011 +0000
@@ -595,7 +595,7 @@
 
         guiInfo.AudioOnly = (int)arg;
 
-        if ((int)arg) {
+        if (guiInfo.AudioOnly) {
             guiInfo.NoWindow = True;
             wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
         } else
--- a/mplayer.c	Mon Jun 27 10:35:25 2011 +0000
+++ b/mplayer.c	Mon Jun 27 10:46:25 2011 +0000
@@ -3678,10 +3678,7 @@
 #ifdef CONFIG_GUI
         if (use_gui) {
             guiInfo.AudioChannels = mpctx->sh_audio ? mpctx->sh_audio->channels : 0;
-            if (!mpctx->sh_video && mpctx->sh_audio)
-                guiGetEvent(guiSetAudioOnly, (void *)1);
-            else
-                guiGetEvent(guiSetAudioOnly, (void *)0);
+            guiGetEvent(guiSetAudioOnly, (void *)(mpctx->sh_audio && !mpctx->sh_video));
             guiGetEvent(guiSetFileFormat, (void *)mpctx->demuxer->file_format);
             if (guiGetEvent(guiSetValues, mpctx->sh_video))
                 goto goto_next_file;