[FFmpeg-devel] [PATCH] ALSA: implement channel layout for playback.

Carl Eugen Hoyos cehoyos
Fri Mar 11 23:43:45 CET 2011

Nicolas George <nicolas.george <at> normalesup.org> writes:

> My hardware do not support surround capture, and I know from experience that
> breaking things is quite easy and hard to debug, so I chose to leave it
> unimplemented with a visible warning.

Inlined is the tested function to reorder 7.1.
More difficult is to fix AV_CH_LAYOUT_4POINT0
(Edward.Scissorhands.x264.DTS-4.0-48_24.mkv), because it has to be mapped to 5.1
- Alsa's 4-channel layout is AV_CH_LAYOUT_QUAD.

Carl Eugen

static void alsa_reorder_s16_out_71(const void *in_v, void *out_v, int n)
    const int16_t *in = in_v;
    int16_t *out = out_v;

    while (n-- > 0) {
        out[0] = in[0];
        out[1] = in[1];
        out[2] = in[4];
        out[3] = in[5];
        out[4] = in[2];
        out[5] = in[3];
        out[6] = in[6];
        out[7] = in[7];
        in  += 8;
        out += 8;

More information about the ffmpeg-devel mailing list