Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/apps/mplayerc/ShockwaveGraph.cpp')
-rw-r--r--src/apps/mplayerc/ShockwaveGraph.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/apps/mplayerc/ShockwaveGraph.cpp b/src/apps/mplayerc/ShockwaveGraph.cpp
index a8e8632fd..0a701d4e3 100644
--- a/src/apps/mplayerc/ShockwaveGraph.cpp
+++ b/src/apps/mplayerc/ShockwaveGraph.cpp
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -243,7 +243,7 @@ STDMETHODIMP CShockwaveGraph::GetVideoSize(long* pWidth, long* pHeight)
// IBasicAudio
STDMETHODIMP CShockwaveGraph::put_Volume(long lVolume)
{
- lVolume = (lVolume == -10000) ? 0 : (int)pow(10.0, ((double)lVolume)/5000+2);
+ lVolume = (lVolume <= -10000) ? 0 : (long)(pow(10.0, lVolume/4000.0)*100);
lVolume = lVolume*0x10000/100;
lVolume = max(min(lVolume, 0xffff), 0);
waveOutSetVolume(0, (lVolume<<16)|lVolume);
@@ -257,7 +257,7 @@ STDMETHODIMP CShockwaveGraph::get_Volume(long* plVolume)
waveOutGetVolume(0, (DWORD*)plVolume);
*plVolume = (*plVolume&0xffff + ((*plVolume>>16)&0xffff)) / 2;
*plVolume = *plVolume*100/0x10000;
- *plVolume = (int)((log10(1.0*(*plVolume))-2)*5000);
+ *plVolume = (long)(4000*log10(*plVolume/100.0f));
*plVolume = max(min(*plVolume, 0), -10000);
return S_OK;