X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibvorbisenc.c;h=bf9476495438c956e366ec4c6ac9fb54280fb575;hb=46dac8cf3d250184ab4247809bc03f60e14f4c0c;hp=f78f872fe2ead128b7b2f1eb08d5f713eb38fd6a;hpb=c6892f59eb0e9f2a9ec1f55b21a5841a60540e1f;p=ffmpeg diff --git a/libavcodec/libvorbisenc.c b/libavcodec/libvorbisenc.c index f78f872fe2e..bf947649543 100644 --- a/libavcodec/libvorbisenc.c +++ b/libavcodec/libvorbisenc.c @@ -70,6 +70,17 @@ static const AVClass vorbis_class = { .version = LIBAVUTIL_VERSION_INT, }; +static const uint8_t vorbis_encoding_channel_layout_offsets[8][8] = { + { 0 }, + { 0, 1 }, + { 0, 2, 1 }, + { 0, 1, 2, 3 }, + { 0, 2, 1, 3, 4 }, + { 0, 2, 1, 4, 5, 3 }, + { 0, 2, 1, 5, 6, 4, 3 }, + { 0, 2, 1, 6, 7, 4, 5, 3 }, +}; + static int vorbis_error_to_averror(int ov_err) { switch (ov_err) { @@ -287,7 +298,7 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, buffer = vorbis_analysis_buffer(&s->vd, samples); for (c = 0; c < channels; c++) { int co = (channels > 8) ? c : - ff_vorbis_encoding_channel_layout_offsets[channels - 1][c]; + vorbis_encoding_channel_layout_offsets[channels - 1][c]; memcpy(buffer[c], frame->extended_data[co], samples * sizeof(*buffer[c])); }