changeset 32941:4c49c83f2af7

Fix -ac a52 to work with codecs with tags other than 0x2000 or dnet which were previously incorrectly byte-swapped.
author reimar
date Sat, 05 Mar 2011 12:24:33 +0000
parents 5bab4a2e1b59
children e3dfc7e2b0f8
files etc/codecs.conf libmpcodecs/ad_liba52.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/etc/codecs.conf	Sat Mar 05 12:09:25 2011 +0000
+++ b/etc/codecs.conf	Sat Mar 05 12:24:33 2011 +0000
@@ -4522,8 +4522,11 @@
   info "AC3-liba52"
   status working
   format 0x2000
-  ; format 0x332D6361 ; ac-3 in mp4  -- not working
+  format 0x332D6361 ; ac-3 in mp4
+  format 0x332D4341
+  format 0x20736D ;  "ms\20" older ac3 fcc (MOV files)
   fourcc dnet
+  fourcc sac3
   driver liba52
   dll "liba52"
 
--- a/libmpcodecs/ad_liba52.c	Sat Mar 05 12:09:25 2011 +0000
+++ b/libmpcodecs/ad_liba52.c	Sat Mar 05 12:24:33 2011 +0000
@@ -83,11 +83,11 @@
 	if(c<0) return -1; /* EOF*/
         sh_audio->a_in_buffer[sh_audio->a_in_buffer_len++]=c;
     }
-    if(sh_audio->format!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8);
+    if(sh_audio->format==MKTAG('d','n','e','t')) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8);
     length = a52_syncinfo (sh_audio->a_in_buffer, &flags, &sample_rate, &bit_rate);
     if(length>=7 && length<=3840) break; /* we're done.*/
     /* bad file => resync*/
-    if(sh_audio->format!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8);
+    if(sh_audio->format==MKTAG('d','n','e','t')) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8);
     memmove(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,7);
     --sh_audio->a_in_buffer_len;
 }
@@ -96,7 +96,7 @@
     sh_audio->i_bps=bit_rate/8;
     sh_audio->samplesize=sh_audio->sample_format==AF_FORMAT_FLOAT_NE ? 4 : 2;
     demux_read_data(sh_audio->ds,sh_audio->a_in_buffer+8,length-8);
-    if(sh_audio->format!=0x2000)
+    if(sh_audio->format==MKTAG('d','n','e','t'))
 	swab(sh_audio->a_in_buffer+8,sh_audio->a_in_buffer+8,length-8);
 
 #ifdef CONFIG_LIBA52_INTERNAL