[FFmpeg-devel] [PATCH] alsdec: channel sorting

Thilo Borgmann thilo.borgmann at googlemail.com
Fri Dec 21 14:50:47 CET 2012


Am 21.12.12 14:21, schrieb Paul B Mahol:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavcodec/alsdec.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)

Probably ok. Have you tested and veryfied using the reference encoder/decoder?



> [...]
> @@ -1480,9 +1481,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
>      {                                                              \
>          int##bps##_t *dest = (int##bps##_t*)ctx->frame.data[0];    \
>          shift = bps - ctx->avctx->bits_per_raw_sample;             \
> +        if (!sconf->chan_sort) {                                   \
>          for (sample = 0; sample < ctx->cur_frame_length; sample++) \
>              for (c = 0; c < avctx->channels; c++)                  \
>                  *dest++ = ctx->raw_samples[c][sample] << shift;    \
> +        } else {                                                                     \
> +            for (sample = 0; sample < ctx->cur_frame_length; sample++)               \
> +                for (c = 0; c < avctx->channels; c++)                                \
> +                    *dest++ = ctx->raw_samples[sconf->chan_pos[c]][sample] << shift; \
> +        }                                                                            \
>      }

Please don't forget to prepare a follow up patch to align the first case and the
closing "\"'s.

-Thilo



More information about the ffmpeg-devel mailing list