diff options
author | Richard Nelson <none@none> | 2010-04-28 18:27:10 -0700 |
---|---|---|
committer | Richard Nelson <none@none> | 2010-04-28 18:27:10 -0700 |
commit | deb2791e55ad1b79fbc44d5d8417301889823ad6 (patch) | |
tree | 27d347df3de7eab4a92ed57e796bddff33f1a636 /indra/media_plugins | |
parent | b7bc6920c89791563e4fd63002e632967ffde966 (diff) |
added optimization for media volume level of 1.0 (don't do anything)
Diffstat (limited to 'indra/media_plugins')
-rw-r--r-- | indra/media_plugins/winmmshim/winmm_shim.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |