changeset 37096:8643426b12de

Simplify code. Move !guiInfo.sh_video condition to existing if (sh_audio) statement.
author ib
date Thu, 08 May 2014 09:15:32 +0000
parents 6cce7a87e800
children 15efbc138bd3
files gui/interface.c gui/win32/interface.c
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gui/interface.c	Wed May 07 14:16:02 2014 +0000
+++ b/gui/interface.c	Thu May 08 09:15:32 2014 +0000
@@ -812,6 +812,12 @@
         if (sh_audio) {
             guiInfo.AudioChannels    = sh_audio->channels;
             guiInfo.AudioPassthrough = (gstrcmp(sh_audio->ad_driver->info->short_name, "hwac3") == 0);
+
+            if (!guiInfo.sh_video) {
+                guiInfo.VideoWindow = False;
+                guiInfo.VideoWidth  = 0;
+                guiInfo.VideoHeight = 0;
+            }
         } else {
             guiInfo.AudioChannels    = 0;
             guiInfo.AudioPassthrough = False;
@@ -822,12 +828,6 @@
         if (guiInfo.AudioChannels < 2 || guiInfo.AudioPassthrough)
             btnSet(evSetBalance, btnDisabled);
 
-        if (sh_audio && !guiInfo.sh_video) {
-            guiInfo.VideoWindow = False;
-            guiInfo.VideoWidth  = 0;
-            guiInfo.VideoHeight = 0;
-        }
-
         if (last_balance < 0.0f) {
             uiEvent(ivSetVolume, guiInfo.Volume);
 
--- a/gui/win32/interface.c	Wed May 07 14:16:02 2014 +0000
+++ b/gui/win32/interface.c	Thu May 08 09:15:32 2014 +0000
@@ -628,13 +628,14 @@
             {
                 guiInfo.AudioChannels = sh_audio->channels;
                 guiInfo.AudioPassthrough = (gstrcmp(sh_audio->ad_driver->info->short_name, "hwac3") == 0);
+
+                if (!guiInfo.sh_video) guiInfo.VideoWindow = FALSE;
             }
             else
             {
                 guiInfo.AudioChannels = 0;
                 guiInfo.AudioPassthrough = FALSE;
             }
-            if (sh_audio && !guiInfo.sh_video) guiInfo.VideoWindow = FALSE;
             if(IsWindowVisible(mygui->videowindow) && !guiInfo.VideoWindow)
                 ShowWindow(mygui->videowindow, SW_HIDE);
             break;