[MPlayer-dev-eng] [PATCH] add support for AC3 endianness

Ulion ulion2002 at gmail.com
Mon Sep 17 02:40:32 CEST 2007


2007/9/17, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Mon, Sep 17, 2007 at 06:00:27AM +0800, Ulion wrote:
> > Should the AF_FORMAT_AC3_LE and AF_FORMAT_AC3_BE format need a 16 bits
> > flag with AF_FORMAT_16BIT?
>
> They are not needed so far, so I'd prefer to not add them. But if you
> see anything in the patch that would make it non-trivial to add it later
> please say so.
>

   case AF_CONTROL_FORMAT_FMT | AF_CONTROL_SET:{
     // Check for errors in configuraton
-    if(AF_OK != check_format(*(int*)arg))
+    if(!AF_FORMAT_IS_AC3(*(int*)arg) && AF_OK != check_format(*(int*)arg))
       return AF_ERROR;

     af->data->format = *(int*)arg;
     af->data->bps = af_fmt2bits(af->data->format)/8;

Here af->data->bps got by af_fmt2bits, although I don't known what's
the usage of the 'bps', but af_fmt2bits not support AC3 format will
always return 8. Since ac3 stream is always 16bits format (does it?),
I prefer to make it return 16 instead, although I don't known whether
it make any different.

-- 
Ulion



More information about the MPlayer-dev-eng mailing list