# HG changeset patch # User ib # Date 1355056101 0 # Node ID 82f34397ebdbbd0b0fda19eed06edf1b3cfdb295 # Parent 1c2cb32a4af99157d964e63f08b851ca215c28b0 Fix bug with wrong balance calculation. Moreover, a change in balance by MPlayer was not displayed. diff -r 1c2cb32a4af9 -r 82f34397ebdb gui/interface.c --- a/gui/interface.c Sun Dec 09 12:23:56 2012 +0000 +++ b/gui/interface.c Sun Dec 09 12:28:21 2012 +0000 @@ -742,23 +742,15 @@ 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;