gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2240-g1650fd2
Date: Thu, 17 Dec 2015 15:32:08 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  1650fd243dd417b791f90945a8c0288da522b8e7 (commit)
      from  e8514ef80100b6ea920c40c3855f6dc599d15ee6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=1650fd243dd417b791f90945a8c0288da522b8e7


commit 1650fd243dd417b791f90945a8c0288da522b8e7
Author: Sandro Santilli <address@hidden>
Date:   Thu Dec 17 16:26:47 2015 +0100

    Use LSB audio rather than MSB one in the default mixer
    
    This was needed to get good mixing on x86_64.
    
    I *think* the AmigaOS was MSB instead
    while Haiku should be fine with LSB
    
    In order to test this with anything but dump-gnash the
    SDL_sound_handler class need be rebuilt without overriding
    the ::mix method

diff --git a/libsound/sound_handler.cpp b/libsound/sound_handler.cpp
index 7644af5..a39cb6e 100644
--- a/libsound/sound_handler.cpp
+++ b/libsound/sound_handler.cpp
@@ -82,36 +82,30 @@ mixAudio(std::uint8_t *dst, const std::uint8_t *src, 
std::uint32_t len, int volu
 {
   if ( volume == 0 ) return;
 
-  // Assume AUDIO_S16MSB
-
+  // AUDIO_S16LSB
   std::int16_t src1, src2;
   int dst_sample;
   const int max_audioval = ((1<<(16-1))-1);
   const int min_audioval = -(1<<(16-1));
 
   len /= 2;
-  while ( len-- ) 
-  {
-    src1 = ((src[0])<<8|src[1]);
+  while ( len-- ) {
+    src1 = ((src[1])<<8|src[0]);
     ADJUST_VOLUME(src1, volume);
-    src2 = ((dst[0])<<8|dst[1]);
+    src2 = ((dst[1])<<8|dst[0]);
     src += 2;
     dst_sample = src1+src2;
-    if ( dst_sample > max_audioval ) 
-    {
+    if ( dst_sample > max_audioval ) {
       dst_sample = max_audioval;
-    } 
-    else
-    if ( dst_sample < min_audioval ) 
-    {
+    } else
+    if ( dst_sample < min_audioval ) {
       dst_sample = min_audioval;
     }
-    dst[1] = dst_sample & 0xFF;
+    dst[0] = dst_sample&0xFF;
     dst_sample >>= 8;
-    dst[0] = dst_sample & 0xFF;
+    dst[1] = dst_sample&0xFF;
     dst += 2;
   }
-       
 }
 
 } // anonymous namespace

-----------------------------------------------------------------------

Summary of changes:
 libsound/sound_handler.cpp |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]