diff options
Diffstat (limited to 'src/apps/mplayerc/QuicktimeGraph.cpp')
-rw-r--r-- | src/apps/mplayerc/QuicktimeGraph.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/apps/mplayerc/QuicktimeGraph.cpp b/src/apps/mplayerc/QuicktimeGraph.cpp index 740041cb5..fbe7ce673 100644 --- a/src/apps/mplayerc/QuicktimeGraph.cpp +++ b/src/apps/mplayerc/QuicktimeGraph.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.
*
@@ -272,8 +272,9 @@ STDMETHODIMP CQuicktimeGraph::GetVideoSize(long* pWidth, long* pHeight) STDMETHODIMP CQuicktimeGraph::put_Volume(long lVolume)
{
if(m_wndDestFrame.theMovie) {
- lVolume = (lVolume == -10000) ? 0 : (int)pow(10.0, (double)lVolume/4152.41 + 2.41);
- SetMovieVolume(m_wndDestFrame.theMovie, (short)max(min(lVolume, 256), 0));
+ short volume = (lVolume <= -10000) ? 0 : (short)(pow(10.0, lVolume/4000.0)*256);
+ volume = max(min(volume, 256), 0);
+ SetMovieVolume(m_wndDestFrame.theMovie, volume);
return S_OK;
}
@@ -284,8 +285,8 @@ STDMETHODIMP CQuicktimeGraph::get_Volume(long* plVolume) CheckPointer(plVolume, E_POINTER);
if(m_wndDestFrame.theMovie) {
- long lVolume = (long)GetMovieVolume(m_wndDestFrame.theMovie);
- *plVolume = (int)((log10(1.0*lVolume)-2.41)*4152.41);
+ *plVolume = (long)GetMovieVolume(m_wndDestFrame.theMovie);
+ *plVolume = (long)(4000*log10(*plVolume/256.0f));
*plVolume = max(min(*plVolume, 0), -10000);
return S_OK;
}
|