]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
a52 - fix 5.1 channel order with recent libavcodec
authorAnssi Hannula <anssi.hannula@iki.fi>
Fri, 27 Nov 2009 15:15:45 +0000 (17:15 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 27 Nov 2009 15:39:27 +0000 (16:39 +0100)
As of SVN r18540 libavcodec expects 5.1 channel audio with SMPTE channel
order. Fix ALSA a52 plugin to use that order when built against such a
libavcodec. Minor version of libavcodec was raised on the same day (Apr
17th 2009), so use that for the check.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
a52/pcm_a52.c

index 1abfdaa60d070dff46bb3bfdcecce2bb6225d374..b95d7d4c4a3b4fb2c231084c5b54c69d2e05f624 100644 (file)
@@ -170,7 +170,13 @@ static int fill_data(snd_pcm_ioplug_t *io,
                static unsigned int ch_index[3][6] = {
                        { 0, 1 },
                        { 0, 1, 2, 3 },
+#if LIBAVCODEC_VERSION_MAJOR > 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 26)
+                       /* current libavcodec expects SMPTE order */
+                       { 0, 1, 4, 5, 2, 3 },
+#else
+                       /* libavcodec older than r18540 expects A52 order */
                        { 0, 4, 1, 2, 3, 5 },
+#endif
                };
                /* flatten copy to n-channel interleaved */
                dst_step = io->channels;