[FFmpeg-devel] [PATCH 2/5] audioconvert: make av_get_channel_layout accept composite names.

Nicolas George nicolas.george at normalesup.org
Sun Nov 6 11:34:09 CET 2011


Le sextidi 16 brumaire, an CCXX, Stefano Sabatini a écrit :
> I wonder if this should be something like "2channels", while a bare
> "2" may be interpreted as the channel layout with code 2.

I believe that writing 2 for stereo is more practical and obvious than
writing 2 for front-right. I changed it to this:

    i = strtol(name, &end, 10);
    if (end - name == name_len)
        return av_get_default_channel_layout(i);
    layout = strtoll(name, &end, 0); 
    if (end - name == name_len)
        return layout;

Thus, "2" (decimal) will mean stereo, while "0x2" (hexadecimal) will mean
front-right.

> Nit: please meaningful names, e.g. cl and cl1 (cl-single will do)

Done: layout and layout_single.

> Note: we may want to extend the function to take a log context +
> offset, and avoid spamming log with unwanted warnings.

That makes an API change for a very dubious reason: I would rather like to
drop the warning altogether. What do you think?

>			      Also please document the extension

AFAIK, there is currently no documentation for the names of the channel
layouts, and the documentation of the filters is rather inconsistent (some
mention libavutil/chlayout.h, which does not exist, some point to the source
code).

Where do you think this information should go? general.texi seems the
obvious place, since it can concern any part.

(No new patch per se as there are still open issues.)

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111106/0327af6f/attachment.asc>


More information about the ffmpeg-devel mailing list