diff options
author | Richard Nelson <none@none> | 2010-04-28 19:06:55 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-04-28 19:06:55 -0700 |
commit | 0ea9fa8d9425cd89a6a8b01b6dc56696ea1b9033 (patch) | |
tree | 7fdf746f08429e5229010f9ecb87f6389f93ebb9 /indra/media_plugins | |
parent | 8c3feea2a2f3bcb648f712f63ea9c4dab8aaa0c3 (diff) | |
parent | a1b765189d4b8bfb6ec99bc5e5c0a2cc4c9ccbd2 (diff) |
merge
Diffstat (limited to 'indra/media_plugins')
-rw-r--r-- | indra/media_plugins/webkit/windows_volume_catcher.cpp | 11 | ||||
-rw-r--r-- | indra/media_plugins/winmmshim/winmm_shim.cpp | 7 |
2 files changed, 8 insertions, 10 deletions
diff --git a/indra/media_plugins/webkit/windows_volume_catcher.cpp b/indra/media_plugins/webkit/windows_volume_catcher.cpp index fdff28c2c1..ef96102a0a 100644 --- a/indra/media_plugins/webkit/windows_volume_catcher.cpp +++ b/indra/media_plugins/webkit/windows_volume_catcher.cpp @@ -34,7 +34,6 @@ #include "volume_catcher.h" #include <windows.h> #include "llsingleton.h" - class VolumeCatcherImpl : public LLSingleton<VolumeCatcherImpl> { friend LLSingleton<VolumeCatcherImpl>; @@ -48,8 +47,8 @@ private: VolumeCatcherImpl(); ~VolumeCatcherImpl(); - typedef void (*set_volume_func_t)(F32); - typedef void (*set_mute_func_t)(bool); + typedef void (WINAPI *set_volume_func_t)(F32); + typedef void (WINAPI *set_mute_func_t)(bool); set_volume_func_t mSetVolumeFunc; set_mute_func_t mSetMuteFunc; @@ -57,7 +56,6 @@ private: F32 mVolume; F32 mPan; }; - VolumeCatcherImpl::VolumeCatcherImpl() : mVolume(1.0f), // default volume is max mPan(0.f) // default pan is centered @@ -77,10 +75,8 @@ VolumeCatcherImpl::~VolumeCatcherImpl() void VolumeCatcherImpl::setVolume(F32 volume) { - //F32 left_volume = volume * min(1.f, 1.f - mPan); - //F32 right_volume = volume * max(0.f, 1.f + mPan); - mVolume = volume; + if (mSetMuteFunc) { mSetMuteFunc(volume == 0.f); @@ -123,3 +119,4 @@ void VolumeCatcher::pump() // No periodic tasks are necessary for this implementation. } + diff --git a/indra/media_plugins/winmmshim/winmm_shim.cpp b/indra/media_plugins/winmmshim/winmm_shim.cpp index f7df3b19a0..88c2a28443 100644 --- a/indra/media_plugins/winmmshim/winmm_shim.cpp +++ b/indra/media_plugins/winmmshim/winmm_shim.cpp @@ -120,8 +120,8 @@ extern "C" { // zero out the audio buffer when muted memset(pwh->lpData, 0, pwh->dwBufferLength); } - else - { + else if (sVolumeLevel != 1.f) + { // need to apply volume level wave_out_map_t::iterator found_it = sWaveOuts.find(hwo); if (found_it != sWaveOuts.end()) { @@ -162,10 +162,11 @@ extern "C" // the captain has turned off the MMX sign, you are now free to use floating point registers _mm_empty(); + // finish remaining samples that didn't fit into 64 bit register for (short* sample_16 = (short*)sample_64; sample_16 < (short*)(pwh->lpData + pwh->dwBufferLength); ++sample_16) - { // finish remaining samples that didn't fit into 64 bit register + { *sample_16 = (*sample_16 * volume_16) >> 15; } |