[MPlayer-cvslog] r24528 - trunk/libmpcodecs/ad_hwac3.c

reimar subversion at mplayerhq.hu
Sat Sep 15 18:30:40 CEST 2007


Author: reimar
Date: Sat Sep 15 18:30:39 2007
New Revision: 24528

Log:
Handle swab when input length is odd (treat it as if there was an additional
0 byte)


Modified:
   trunk/libmpcodecs/ad_hwac3.c

Modified: trunk/libmpcodecs/ad_hwac3.c
==============================================================================
--- trunk/libmpcodecs/ad_hwac3.c	(original)
+++ trunk/libmpcodecs/ad_hwac3.c	Sat Sep 15 18:30:39 2007
@@ -168,6 +168,11 @@ static int decode_audio(sh_audio_t *sh_a
     memcpy(buf + 8, sh_audio->a_in_buffer, len);
 #else
     swab(sh_audio->a_in_buffer, buf + 8, len);
+    if (len & 1) {
+      buf[8+len-1] = 0;
+      buf[8+len] = sh_audio->a_in_buffer[len-1];
+      len++;
+    }
 #endif
     memset(buf + 8 + len, 0, 6144 - 8 - len);
 
@@ -361,8 +366,11 @@ static int decode_audio_dts(unsigned cha
   memcpy(&buf[8], indata_ptr, fsize);
 #else
   swab(indata_ptr, &buf[8], fsize);
-  if (fsize & 1)
-    buf[8+fsize-1] = indata_ptr[fsize-1];
+  if (fsize & 1) {
+    buf[8+fsize-1] = 0;
+    buf[8+fsize] = indata_ptr[fsize-1];
+    fsize++;
+  }
 #endif
   memset(&buf[fsize + 8], 0, nr_samples * 2 * 2 - (fsize + 8));
 



More information about the MPlayer-cvslog mailing list