summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-17 11:35:32 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-17 11:35:32 +0000
commit5ee6845f26a85d4578d7739a33e4a916329d5694 (patch)
tree6b5ee6d2cddc5ea1b448266d7056a5669d61a132 /libmpcodecs
parent00a89df19aa5988ac4e78aea57a3923e85a659d2 (diff)
downloadmpv-5ee6845f26a85d4578d7739a33e4a916329d5694.tar.bz2
mpv-5ee6845f26a85d4578d7739a33e4a916329d5694.tar.xz
ac3 byteswapping support (when format!=0x2000)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10120 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_liba52.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c
index 4397c72bc2..b25e670b2f 100644
--- a/libmpcodecs/ad_liba52.c
+++ b/libmpcodecs/ad_liba52.c
@@ -43,21 +43,25 @@ int bit_rate=0;
sh_audio->a_in_buffer_len=0;
/* sync frame:*/
while(1){
- while(sh_audio->a_in_buffer_len<7){
+ while(sh_audio->a_in_buffer_len<8){
int c=demux_getc(sh_audio->ds);
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);
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*/
- memcpy(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,6);
+ if(sh_audio->format!=0x2000) swab(sh_audio->a_in_buffer,sh_audio->a_in_buffer,8);
+ memcpy(sh_audio->a_in_buffer,sh_audio->a_in_buffer+1,7);
--sh_audio->a_in_buffer_len;
}
mp_msg(MSGT_DECAUDIO,MSGL_DBG2,"a52: len=%d flags=0x%X %d Hz %d bit/s\n",length,flags,sample_rate,bit_rate);
sh_audio->samplerate=sample_rate;
sh_audio->i_bps=bit_rate/8;
- demux_read_data(sh_audio->ds,sh_audio->a_in_buffer+7,length-7);
+ demux_read_data(sh_audio->ds,sh_audio->a_in_buffer+8,length-8);
+ if(sh_audio->format!=0x2000)
+ swab(sh_audio->a_in_buffer+8,sh_audio->a_in_buffer+8,length-8);
if(crc16_block(sh_audio->a_in_buffer+2,length-2)!=0)
mp_msg(MSGT_DECAUDIO,MSGL_STATUS,"a52: CRC check failed! \n");