[MPlayer-cvslog] r35636 - trunk/gui/interface.c
ib
subversion at mplayerhq.hu
Sun Dec 9 15:41:24 CET 2012
Author: ib
Date: Sun Dec 9 15:41:24 2012
New Revision: 35636
Log:
Set volume in GUI_SET_MIXER.
This in missing in r35631.
Modified:
trunk/gui/interface.c
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Sun Dec 9 14:19:42 2012 (r35635)
+++ trunk/gui/interface.c Sun Dec 9 15:41:24 2012 (r35636)
@@ -751,6 +751,7 @@ int gui(int what, void *data)
if (mixer) {
float l, r, b;
+ static float last_balance = 50.0f;
mixer_getvolume(mixer, &l, &r);
guiInfo.Volume = FFMAX(l, r);
@@ -758,7 +759,14 @@ int gui(int what, void *data)
mixer_getbalance(mixer, &b);
guiInfo.Balance = (b + 1.0) * 50.0;
- btnModify(evSetBalance, guiInfo.Balance);
+
+ if (guiInfo.Balance != last_balance) {
+ l = guiInfo.Volume * (100.0 - guiInfo.Balance) / 50.0;
+ r = guiInfo.Volume * guiInfo.Balance / 50.0;
+ mixer_setvolume(mixer, FFMIN(l, guiInfo.Volume), FFMIN(r, guiInfo.Volume));
+ btnModify(evSetBalance, guiInfo.Balance);
+ last_balance = guiInfo.Balance;
+ }
}
break;
More information about the MPlayer-cvslog
mailing list