1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

ad_liba52: Fix -ac a52 with tags other than 0x2000 or dnet

Audio with all codec tags other than 0x2000 was byte-swapped, while
only "dnet" should be.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33028 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2011-03-05 12:24:33 +00:00 committed by Uoti Urpala
parent 7a3fd839ef
commit 55dbd183e3
2 changed files with 7 additions and 4 deletions

View File

@ -4459,8 +4459,11 @@ audiocodec a52
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"

View File

@ -81,11 +81,11 @@ while(1){
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;
}
@ -94,7 +94,7 @@ while(1){
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