# HG changeset patch # User aurel # Date 1193939883 0 # Node ID 0fc269ea29198487242e530e0e7cddc4ecc882f3 # Parent ad587a64ef52117e925e0bbd33a9da4dc5e53f3e cleanup and simplify adx_decode_header() diff -r ad587a64ef52 -r 0fc269ea2919 adx.c --- a/adx.c Thu Nov 01 17:50:05 2007 +0000 +++ b/adx.c Thu Nov 01 17:58:03 2007 +0000 @@ -249,35 +249,18 @@ #endif //CONFIG_ENCODERS -static int is_adx(const unsigned char *buf,size_t bufsize) +/* return data offset or 0 */ +static int adx_decode_header(AVCodecContext *avctx,const unsigned char *buf,size_t bufsize) { - int offset; + int offset; if (buf[0]!=0x80) return 0; offset = (AV_RB32(buf)^0x80000000)+4; if (bufsizesample_rate = freq; - avctx->channels = channels; - avctx->bit_rate = freq*channels*18*8/32; -// avctx->frame_size = 18*channels; + avctx->channels = buf[7]; + avctx->sample_rate = AV_RB32(buf+8); + avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32; return offset; }