[MPlayer-cvslog] r35631 - trunk/gui/interface.c

ib subversion at mplayerhq.hu
Sun Dec 9 13:28:21 CET 2012


Author: ib
Date: Sun Dec  9 13:28:21 2012
New Revision: 35631

Log:
Fix bug with wrong balance calculation.

Moreover, a change in balance by MPlayer was not displayed.

Modified:
   trunk/gui/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Sun Dec  9 13:23:56 2012	(r35630)
+++ trunk/gui/interface.c	Sun Dec  9 13:28:21 2012	(r35631)
@@ -742,23 +742,15 @@ int gui(int what, void *data)
             mixer = mpctx_get_mixer(guiInfo.mpcontext);
 
         if (mixer) {
-            float l, r;
-            static float last_balance = -1;
+            float l, r, b;
 
             mixer_getvolume(mixer, &l, &r);
-
             guiInfo.Volume = FFMAX(l, r);
             btnModify(evSetVolume, guiInfo.Volume);
 
-            if (guiInfo.Balance != last_balance) {
-                if (guiInfo.Volume)
-                    guiInfo.Balance = ((r - l) / guiInfo.Volume + 1.0) * 50.0;
-                else
-                    guiInfo.Balance = 50.0f;
-
-                last_balance = guiInfo.Balance;
+            mixer_getbalance(mixer, &b);
+            guiInfo.Balance = (b + 1.0) * 50.0;
                 btnModify(evSetBalance, guiInfo.Balance);
-            }
         }
         break;
 


More information about the MPlayer-cvslog mailing list