changeset 4182:17d005bf07f2 libavcodec

Output proper 16-bit sound (fixes decoding on PPC)
author kostya
date Mon, 13 Nov 2006 05:15:55 +0000
parents 580d2c397251
children c70922cdf2ee
files vmdav.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/vmdav.c	Sun Nov 12 23:35:49 2006 +0000
+++ b/vmdav.c	Mon Nov 13 05:15:55 2006 +0000
@@ -484,10 +484,13 @@
         } else {
             if (s->bits == 16)
                 vmdaudio_decode_audio(s, data, buf, 1);
-            else
+            else {
                 /* copy the data but convert it to signed */
-                for (i = 0; i < s->block_align; i++)
-                    data[i * 2 + 1] = buf[i] + 0x80;
+                for (i = 0; i < s->block_align; i++){
+                    *data++ = buf[i] + 0x80;
+                    *data++ = buf[i] + 0x80;
+                }
+            }
         }
     } else {
         bytes_decoded = s->block_align * 2;
@@ -500,8 +503,10 @@
                 vmdaudio_decode_audio(s, data, buf, 0);
             } else {
                 /* copy the data but convert it to signed */
-                for (i = 0; i < s->block_align; i++)
-                    data[i * 2 + 1] = buf[i] + 0x80;
+                for (i = 0; i < s->block_align; i++){
+                    *data++ = buf[i] + 0x80;
+                    *data++ = buf[i] + 0x80;
+                }
             }
         }
     }