diff mbox

[FFmpeg-devel] avformat/framehash: also print channel layout as a string

Message ID 20160929000507.1588-1-jamrial@gmail.com
State Accepted
Headers show

Commit Message

James Almer Sept. 29, 2016, 12:05 a.m. UTC
This should be more useful for users since numerical values for channel
layout can be confusing and unintuitive.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/framehash.c                         |  3 +++
 tests/ref/fate/8bps                             |  1 +
 tests/ref/fate/adpcm-4xm                        |  1 +
 tests/ref/fate/adpcm-afc                        |  1 +
 tests/ref/fate/adpcm-dtk                        |  1 +
 tests/ref/fate/adpcm-ea-1                       |  1 +
 tests/ref/fate/adpcm-ea-2                       |  1 +
 tests/ref/fate/adpcm-ea-maxis-xa                |  1 +
 tests/ref/fate/adpcm-ea-r1                      |  1 +
 tests/ref/fate/adpcm-ima-amv                    |  1 +
 tests/ref/fate/adpcm-ima-ea-eacs                |  1 +
 tests/ref/fate/adpcm-ima-ea-sead                |  1 +
 tests/ref/fate/adpcm-ima-smjpeg                 |  1 +
 tests/ref/fate/adpcm-ima-ws                     |  1 +
 tests/ref/fate/adpcm-ms-mono                    |  1 +
 tests/ref/fate/adpcm-thp                        |  1 +
 tests/ref/fate/adpcm-vima                       |  1 +
 tests/ref/fate/adpcm-xa                         |  1 +
 tests/ref/fate/adtstoasc_ticket3715             |  1 +
 tests/ref/fate/armovie-escape124                |  1 +
 tests/ref/fate/bethsoft-vid                     |  1 +
 tests/ref/fate/bfi                              |  1 +
 tests/ref/fate/bmv-audio                        |  1 +
 tests/ref/fate/cdxl-demux                       |  1 +
 tests/ref/fate/copy-trac236                     |  1 +
 tests/ref/fate/copy-trac4914                    |  1 +
 tests/ref/fate/copy-trac4914-avi                |  1 +
 tests/ref/fate/corepng                          |  1 +
 tests/ref/fate/creatureshock-avs                |  1 +
 tests/ref/fate/cyberia-c93                      |  1 +
 tests/ref/fate/d-cinema-demux                   |  1 +
 tests/ref/fate/dca-xll_51_16_192_768_0          |  1 +
 tests/ref/fate/dca-xll_51_16_192_768_0-dmix_2   |  1 +
 tests/ref/fate/dca-xll_51_16_192_768_0-dmix_6   |  1 +
 tests/ref/fate/dca-xll_51_16_192_768_1          |  1 +
 tests/ref/fate/dca-xll_51_16_192_768_1-dmix_2   |  1 +
 tests/ref/fate/dca-xll_51_16_192_768_1-dmix_6   |  1 +
 tests/ref/fate/dca-xll_51_24_48_768             |  1 +
 tests/ref/fate/dca-xll_51_24_48_768-dmix_2      |  1 +
 tests/ref/fate/dca-xll_51_24_48_768-dmix_6      |  1 +
 tests/ref/fate/dca-xll_51_24_48_none            |  1 +
 tests/ref/fate/dca-xll_51_24_48_none-dmix_2     |  1 +
 tests/ref/fate/dca-xll_51_24_48_none-dmix_6     |  1 +
 tests/ref/fate/dca-xll_71_24_48_768_0           |  1 +
 tests/ref/fate/dca-xll_71_24_48_768_0-dmix_2    |  1 +
 tests/ref/fate/dca-xll_71_24_48_768_0-dmix_6    |  1 +
 tests/ref/fate/dca-xll_71_24_48_768_1           |  1 +
 tests/ref/fate/dca-xll_71_24_48_768_1-dmix_2    |  1 +
 tests/ref/fate/dca-xll_71_24_48_768_1-dmix_6    |  1 +
 tests/ref/fate/dca-xll_71_24_96_768             |  1 +
 tests/ref/fate/dca-xll_71_24_96_768-dmix_2      |  1 +
 tests/ref/fate/dca-xll_71_24_96_768-dmix_6      |  1 +
 tests/ref/fate/dca-xll_x96_51_24_96_1509        |  1 +
 tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_2 |  1 +
 tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_6 |  1 +
 tests/ref/fate/dca-xll_xch_61_24_48_768         |  1 +
 tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_2  |  1 +
 tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_6  |  1 +
 tests/ref/fate/dcinema-encode                   |  1 +
 tests/ref/fate/delphine-cin-audio               |  1 +
 tests/ref/fate/dpcm-idroq                       |  1 +
 tests/ref/fate/dpcm-interplay                   |  1 +
 tests/ref/fate/dss-lp                           |  1 +
 tests/ref/fate/dss-sp                           |  1 +
 tests/ref/fate/ffmpeg-filter_colorkey           |  1 +
 tests/ref/fate/filter-acrossfade                |  1 +
 tests/ref/fate/filter-adelay                    |  1 +
 tests/ref/fate/filter-aecho                     |  1 +
 tests/ref/fate/filter-aemphasis-50fm            |  1 +
 tests/ref/fate/filter-aemphasis-75kf            |  1 +
 tests/ref/fate/filter-afade-esin                |  1 +
 tests/ref/fate/filter-afade-exp                 |  1 +
 tests/ref/fate/filter-afade-hsin                |  1 +
 tests/ref/fate/filter-afade-iqsin               |  1 +
 tests/ref/fate/filter-afade-log                 |  1 +
 tests/ref/fate/filter-afade-qsin                |  1 +
 tests/ref/fate/filter-agate                     |  1 +
 tests/ref/fate/filter-alimiter                  |  1 +
 tests/ref/fate/filter-amerge                    |  1 +
 tests/ref/fate/filter-anequalizer               |  1 +
 tests/ref/fate/filter-apad                      |  1 +
 tests/ref/fate/filter-asetnsamples              |  1 +
 tests/ref/fate/filter-asetrate                  |  1 +
 tests/ref/fate/filter-atrim-duration            |  1 +
 tests/ref/fate/filter-atrim-mixed               |  1 +
 tests/ref/fate/filter-atrim-samples             |  1 +
 tests/ref/fate/filter-atrim-time                |  1 +
 tests/ref/fate/filter-chorus                    |  1 +
 tests/ref/fate/filter-compand                   |  1 +
 tests/ref/fate/filter-concat                    |  1 +
 tests/ref/fate/filter-dcshift                   |  1 +
 tests/ref/fate/filter-earwax                    |  1 +
 tests/ref/fate/filter-extrastereo               |  1 +
 tests/ref/fate/filter-hls                       |  1 +
 tests/ref/fate/filter-hls-append                |  1 +
 tests/ref/fate/filter-meta-4560-rotate0         |  1 +
 tests/ref/fate/filter-overlay-dvdsub-2397       |  1 +
 tests/ref/fate/filter-silenceremove             |  1 +
 tests/ref/fate/filter-stereotools               |  1 +
 tests/ref/fate/filter-tremolo                   |  1 +
 tests/ref/fate/flv-demux                        |  1 +
 tests/ref/fate/g722-encode                      |  1 +
 tests/ref/fate/g722dec-1                        |  1 +
 tests/ref/fate/g723_1-dec-1                     |  1 +
 tests/ref/fate/g723_1-dec-2                     |  1 +
 tests/ref/fate/g723_1-dec-3                     |  1 +
 tests/ref/fate/g723_1-dec-4                     |  1 +
 tests/ref/fate/g723_1-dec-5                     |  1 +
 tests/ref/fate/g723_1-dec-6                     |  1 +
 tests/ref/fate/g723_1-dec-7                     |  1 +
 tests/ref/fate/g723_1-dec-8                     |  1 +
 tests/ref/fate/g726-encode-2bit                 |  1 +
 tests/ref/fate/g726-encode-3bit                 |  1 +
 tests/ref/fate/g726-encode-4bit                 |  1 +
 tests/ref/fate/g726-encode-5bit                 |  1 +
 tests/ref/fate/gapless-mp3                      | 10 +++++-----
 tests/ref/fate/gsm-ms                           |  1 +
 tests/ref/fate/gsm-toast                        |  1 +
 tests/ref/fate/h264-skip-nointra                |  1 +
 tests/ref/fate/h264-skip-nokey                  |  1 +
 tests/ref/fate/h264-xavc-4389                   |  1 +
 tests/ref/fate/id-cin-video                     |  1 +
 tests/ref/fate/jv-demux                         |  1 +
 tests/ref/fate/lmlm4-demux                      |  1 +
 tests/ref/fate/maxis-xa                         |  1 +
 tests/ref/fate/mkv                              |  1 +
 tests/ref/fate/mkv-1242                         |  1 +
 tests/ref/fate/mov-mp3-demux                    |  1 +
 tests/ref/fate/mtv                              |  1 +
 tests/ref/fate/mxf-demux                        |  1 +
 tests/ref/fate/nsv-demux                        |  1 +
 tests/ref/fate/oggopus-demux                    |  1 +
 tests/ref/fate/on2avc                           |  1 +
 tests/ref/fate/paf-audio                        |  1 +
 tests/ref/fate/paf-demux                        |  1 +
 tests/ref/fate/pcm-planar                       |  1 +
 tests/ref/fate/pcm_dvd                          |  1 +
 tests/ref/fate/pmp-demux                        |  1 +
 tests/ref/fate/prores-gray                      |  1 +
 tests/ref/fate/prores-transparency              |  1 +
 tests/ref/fate/prores-transparency_skip         |  1 +
 tests/ref/fate/psx-str-demux                    |  1 +
 tests/ref/fate/pva-demux                        |  1 +
 tests/ref/fate/ra3-144                          |  1 +
 tests/ref/fate/redcode-demux                    |  1 +
 tests/ref/fate/sierra-vmd-audio                 |  1 +
 tests/ref/fate/siff-demux                       |  1 +
 tests/ref/fate/smacker-audio                    |  1 +
 tests/ref/fate/smjpeg-demux                     |  1 +
 tests/ref/fate/sp5x                             |  1 +
 tests/ref/fate/tiertex-seq                      |  1 +
 tests/ref/fate/tmv                              |  1 +
 tests/ref/fate/ts-demux                         |  1 +
 tests/ref/fate/ts-opus-demux                    |  1 +
 tests/ref/fate/tscc-15bit                       |  1 +
 tests/ref/fate/vqf-demux                        |  2 +-
 tests/ref/fate/wav-ac3                          |  1 +
 tests/ref/fate/wc3movie-xan                     |  1 +
 tests/ref/fate/westwood-aud                     |  1 +
 tests/ref/fate/wmv8-drm-nodec                   |  1 +
 tests/ref/fate/wtv-demux                        |  1 +
 tests/ref/fate/xmv-demux                        |  1 +
 162 files changed, 168 insertions(+), 6 deletions(-)

Comments

Michael Niedermayer Nov. 5, 2016, 11:55 p.m. UTC | #1
On Wed, Sep 28, 2016 at 09:05:07PM -0300, James Almer wrote:
> This should be more useful for users since numerical values for channel
> layout can be confusing and unintuitive.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>

LGTM

thx

[...]
James Almer Nov. 6, 2016, 1:45 a.m. UTC | #2
On 11/5/2016 8:55 PM, Michael Niedermayer wrote:
> On Wed, Sep 28, 2016 at 09:05:07PM -0300, James Almer wrote:
>> This should be more useful for users since numerical values for channel
>> layout can be confusing and unintuitive.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
> 
> LGTM
> 
> thx

Pushed.
diff mbox

Patch

diff --git a/libavformat/framehash.c b/libavformat/framehash.c
index 4c5499e..3ae9092 100644
--- a/libavformat/framehash.c
+++ b/libavformat/framehash.c
@@ -29,13 +29,16 @@  int ff_framehash_write_header(AVFormatContext *s)
     for (i = 0; i < s->nb_streams; i++) {
         AVStream *st = s->streams[i];
         AVCodecParameters *avctx = st->codecpar;
+        char buf[256] = { 0 };
         avio_printf(s->pb, "#tb %d: %d/%d\n", i, st->time_base.num, st->time_base.den);
         avio_printf(s->pb, "#media_type %d: %s\n", i, av_get_media_type_string(avctx->codec_type));
         avio_printf(s->pb, "#codec_id %d: %s\n", i, avcodec_get_name(avctx->codec_id));
         switch (avctx->codec_type) {
         case AVMEDIA_TYPE_AUDIO:
+            av_get_channel_layout_string(buf, sizeof(buf), avctx->channels, avctx->channel_layout);
             avio_printf(s->pb, "#sample_rate %d: %d\n", i,avctx->sample_rate);
             avio_printf(s->pb, "#channel_layout %d: %"PRIx64"\n", i,avctx->channel_layout);
+            avio_printf(s->pb, "#channel_layout_name %d: %s\n", i, buf);
             break;
         case AVMEDIA_TYPE_VIDEO:
             avio_printf(s->pb, "#dimensions %d: %dx%d\n", i, avctx->width, avctx->height);
diff --git a/tests/ref/fate/8bps b/tests/ref/fate/8bps
index c6287ff..dab2b90 100644
--- a/tests/ref/fate/8bps
+++ b/tests/ref/fate/8bps
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 22050
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   259200, 0x7e91df07
 1,          0,          0,     1024,     2048, 0x3d042426
 1,       1024,       1024,     1024,     2048, 0x5bcae456
diff --git a/tests/ref/fate/adpcm-4xm b/tests/ref/fate/adpcm-4xm
index cb725e5..cfde412 100644
--- a/tests/ref/fate/adpcm-4xm
+++ b/tests/ref/fate/adpcm-4xm
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1472,     5888, 0x9086e310
 0,       1476,       1476,     1472,     5888, 0xac8491f5
 0,       2952,       2952,     1472,     5888, 0xc9a08b6b
diff --git a/tests/ref/fate/adpcm-afc b/tests/ref/fate/adpcm-afc
index 0cf61a9..6d8e732 100644
--- a/tests/ref/fate/adpcm-afc
+++ b/tests/ref/fate/adpcm-afc
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,    17920,    71680, 0x52373bc9
 0,      17920,      17920,    17920,    71680, 0x1f854b27
 0,      35840,      35840,    17920,    71680, 0x3d265a6d
diff --git a/tests/ref/fate/adpcm-dtk b/tests/ref/fate/adpcm-dtk
index acdf033..f3ade6d 100644
--- a/tests/ref/fate/adpcm-dtk
+++ b/tests/ref/fate/adpcm-dtk
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 48000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,      896,     3584, 0xdae789d5
 0,        896,        896,      896,     3584, 0x168ed9b6
 0,       1792,       1792,      896,     3584, 0x8920c8d5
diff --git a/tests/ref/fate/adpcm-ea-1 b/tests/ref/fate/adpcm-ea-1
index fa9906c..76be8e8 100644
--- a/tests/ref/fate/adpcm-ea-1
+++ b/tests/ref/fate/adpcm-ea-1
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1484,     5936, 0x00000000
 0,       1484,       1484,     1456,     5824, 0x00000000
 0,       2940,       2940,     1484,     5936, 0x00000000
diff --git a/tests/ref/fate/adpcm-ea-2 b/tests/ref/fate/adpcm-ea-2
index 4743e3d..9144087 100644
--- a/tests/ref/fate/adpcm-ea-2
+++ b/tests/ref/fate/adpcm-ea-2
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1484,     5936, 0xea261a29
 0,       1484,       1484,     1456,     5824, 0x253df061
 0,       2940,       2940,     1484,     5936, 0x603a5bd7
diff --git a/tests/ref/fate/adpcm-ea-maxis-xa b/tests/ref/fate/adpcm-ea-maxis-xa
index b300c32..c919a67 100644
--- a/tests/ref/fate/adpcm-ea-maxis-xa
+++ b/tests/ref/fate/adpcm-ea-maxis-xa
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,       28,      112, 0x291d1be4
 0,         28,         28,       28,      112, 0xf08d33cc
 0,         56,         56,       28,      112, 0x5b1521de
diff --git a/tests/ref/fate/adpcm-ea-r1 b/tests/ref/fate/adpcm-ea-r1
index 2208eb0..4e5fb67 100644
--- a/tests/ref/fate/adpcm-ea-r1
+++ b/tests/ref/fate/adpcm-ea-r1
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 48000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1624,     6496, 0x00000000
 0,       1624,       1624,     1596,     6384, 0x00000000
 0,       3220,       3220,     1596,     6384, 0x00000000
diff --git a/tests/ref/fate/adpcm-ima-amv b/tests/ref/fate/adpcm-ima-amv
index def9279..eb174df 100644
--- a/tests/ref/fate/adpcm-ima-amv
+++ b/tests/ref/fate/adpcm-ima-amv
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,     1378,     2756, 0x0af35034
 0,       1378,       1378,     1378,     2756, 0x8462443f
 0,       2756,       2756,     1378,     2756, 0x9f493ba6
diff --git a/tests/ref/fate/adpcm-ima-ea-eacs b/tests/ref/fate/adpcm-ima-ea-eacs
index d5ea2e5..fcfcbeb 100644
--- a/tests/ref/fate/adpcm-ima-ea-eacs
+++ b/tests/ref/fate/adpcm-ima-ea-eacs
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1468,     5872, 0x00000000
 0,       1468,       1468,     1468,     5872, 0x00000000
 0,       2936,       2936,     1468,     5872, 0x00000000
diff --git a/tests/ref/fate/adpcm-ima-ea-sead b/tests/ref/fate/adpcm-ima-ea-sead
index 563bb49..2d52efe 100644
--- a/tests/ref/fate/adpcm-ima-ea-sead
+++ b/tests/ref/fate/adpcm-ima-ea-sead
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,      736,     2944, 0x00000000
 0,        736,        736,     1472,     5888, 0x5ae3c2a4
 0,       2208,       2208,     1472,     5888, 0x158fbcb4
diff --git a/tests/ref/fate/adpcm-ima-smjpeg b/tests/ref/fate/adpcm-ima-smjpeg
index f88520d..d56014e 100644
--- a/tests/ref/fate/adpcm-ima-smjpeg
+++ b/tests/ref/fate/adpcm-ima-smjpeg
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      512,     1024, 0x00000000
 0,        512,        512,      512,     1024, 0x00000000
 0,       1024,       1024,      512,     1024, 0xed2d3f6b
diff --git a/tests/ref/fate/adpcm-ima-ws b/tests/ref/fate/adpcm-ima-ws
index 0e41e1e..d1e6b61 100644
--- a/tests/ref/fate/adpcm-ima-ws
+++ b/tests/ref/fate/adpcm-ima-ws
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,    11024,    22048, 0x0665d7f4
 0,      11024,      11024,     1470,     2940, 0x0f3c64cb
 0,      12494,      12494,     1470,     2940, 0xc90b9e78
diff --git a/tests/ref/fate/adpcm-ms-mono b/tests/ref/fate/adpcm-ms-mono
index 254dc8a..e3f217d 100644
--- a/tests/ref/fate/adpcm-ms-mono
+++ b/tests/ref/fate/adpcm-ms-mono
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 11025
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      500,     1000, 0x64cd9403
 0,        500,        500,      500,     1000, 0xa4ef8a9d
 0,       1000,       1000,      500,     1000, 0x75c19868
diff --git a/tests/ref/fate/adpcm-thp b/tests/ref/fate/adpcm-thp
index ff49303..592c661 100644
--- a/tests/ref/fate/adpcm-thp
+++ b/tests/ref/fate/adpcm-thp
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 32000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1078,     4312, 0x469714f6
 0,       1078,       1078,     1064,     4256, 0x6ca28f25
 0,       2142,       2142,     1078,     4312, 0xd466f806
diff --git a/tests/ref/fate/adpcm-vima b/tests/ref/fate/adpcm-vima
index 5bc62c3..b22f128 100644
--- a/tests/ref/fate/adpcm-vima
+++ b/tests/ref/fate/adpcm-vima
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,    73500,   294000, 0x37d439ee
 0,      73500,      73500,     1470,     5880, 0xe524b177
 0,      74970,      74970,     1470,     5880, 0x9e784af1
diff --git a/tests/ref/fate/adpcm-xa b/tests/ref/fate/adpcm-xa
index e365227..15b62ec 100644
--- a/tests/ref/fate/adpcm-xa
+++ b/tests/ref/fate/adpcm-xa
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 37800
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     2016,     8064, 0xa307ed8c
 0,       2016,       2016,     2016,     8064, 0xd2551927
 0,       4032,       4032,     2016,     8064, 0x3264a799
diff --git a/tests/ref/fate/adtstoasc_ticket3715 b/tests/ref/fate/adtstoasc_ticket3715
index ff8e8ab..949b565 100644
--- a/tests/ref/fate/adtstoasc_ticket3715
+++ b/tests/ref/fate/adtstoasc_ticket3715
@@ -6,6 +6,7 @@  ef8ce3cbd1d86113e7c991a816086068 *tests/data/fate/adtstoasc_ticket3715.mov
 #codec_id 0: aac
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,      371, 0x14b11a4f
 0,       1024,       1024,     1024,      402, 0x2f00c487
 0,       2048,       2048,     1024,      403, 0x1959c0d4
diff --git a/tests/ref/fate/armovie-escape124 b/tests/ref/fate/armovie-escape124
index 5c8f051..398ff76 100644
--- a/tests/ref/fate/armovie-escape124
+++ b/tests/ref/fate/armovie-escape124
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 44100
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,   230400, 0xd133e177
 1,          0,          0,    44100,   176400, 0xdd61578c
 0,          1,          1,        1,   230400, 0xe3501bb2
diff --git a/tests/ref/fate/bethsoft-vid b/tests/ref/fate/bethsoft-vid
index ccb0d37..25a62ae 100644
--- a/tests/ref/fate/bethsoft-vid
+++ b/tests/ref/fate/bethsoft-vid
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 11111
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   192000, 0x00000000
 1,          0,          0,      740,     1480, 0x00000000
 1,        740,        740,      740,     1480, 0x20a92bd4
diff --git a/tests/ref/fate/bfi b/tests/ref/fate/bfi
index 807615c..277c935 100644
--- a/tests/ref/fate/bfi
+++ b/tests/ref/fate/bfi
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 11025
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   134400, 0xc218b00c
 1,          0,          0,     8884,    17768, 0x07df135c
 0,          1,          1,        1,   134400, 0x114daf7c
diff --git a/tests/ref/fate/bmv-audio b/tests/ref/fate/bmv-audio
index 62f9c5e..6e1a4c2 100644
--- a/tests/ref/fate/bmv-audio
+++ b/tests/ref/fate/bmv-audio
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1856,     7424, 0x18540b36
 0,       1856,       1856,     1824,     7296, 0x5acd2484
 0,       3680,       3680,     1856,     7424, 0xa1bc5c5a
diff --git a/tests/ref/fate/cdxl-demux b/tests/ref/fate/cdxl-demux
index 828b2c9..f133475 100644
--- a/tests/ref/fate/cdxl-demux
+++ b/tests/ref/fate/cdxl-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s8
 #sample_rate 1: 11025
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,     1884,    22688, 0xc954a244
 1,          0,          0,     1884,     1884, 0x06925e3e
 0,       1884,       1884,     1884,    22688, 0x3ee4a304
diff --git a/tests/ref/fate/copy-trac236 b/tests/ref/fate/copy-trac236
index 167446c..c5240ca 100644
--- a/tests/ref/fate/copy-trac236
+++ b/tests/ref/fate/copy-trac236
@@ -10,6 +10,7 @@  d6e3d97b522ce881ed29c5da74cc7e63 *tests/data/fate/copy-trac236.mov
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,   518400, 0x81ab2140
 1,          0,          0,     1024,     4096, 0x67dc99a3
 1,       1024,       1024,     1024,     4096, 0xf115a681
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index 3a6eee4..ef06b8f 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -10,6 +10,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,   259200, 0xf36957da
 1,          0,          0,     1602,     6408, 0x1dd7b37c
 0,          1,          1,        1,   259200, 0x29a1f586
diff --git a/tests/ref/fate/copy-trac4914-avi b/tests/ref/fate/copy-trac4914-avi
index e02744d..0358ead 100644
--- a/tests/ref/fate/copy-trac4914-avi
+++ b/tests/ref/fate/copy-trac4914-avi
@@ -10,6 +10,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 1,          0,          0,     1152,     4608, 0xb24f5c9d
 1,       1152,       1152,     1152,     4608, 0xe2da5c32
 1,       2304,       2304,     1152,     4608, 0xd76023d9
diff --git a/tests/ref/fate/corepng b/tests/ref/fate/corepng
index 4c106ed..74bb920 100644
--- a/tests/ref/fate/corepng
+++ b/tests/ref/fate/corepng
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 11025
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   230400, 0x03e25ead
 1,          0,          0,     5513,    11026, 0x27ad637c
 0,          1,          1,        1,   230400, 0x0a520ffd
diff --git a/tests/ref/fate/creatureshock-avs b/tests/ref/fate/creatureshock-avs
index 82460b2..c8e08c9 100644
--- a/tests/ref/fate/creatureshock-avs
+++ b/tests/ref/fate/creatureshock-avs
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 22222
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   188892, 0x9f47a5ec
 1,          0,          0,     8186,    16372, 0xfaaab59d
 0,          1,          1,        1,   188892, 0xdece0269
diff --git a/tests/ref/fate/cyberia-c93 b/tests/ref/fate/cyberia-c93
index 5eb4336..e7a5b5a 100644
--- a/tests/ref/fate/cyberia-c93
+++ b/tests/ref/fate/cyberia-c93
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 16129
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   184320, 0x8433f0f8
 1,          0,          0,    14184,    28368, 0xaacc96a5
 0,          1,          1,        1,   184320, 0xd0d480f7
diff --git a/tests/ref/fate/d-cinema-demux b/tests/ref/fate/d-cinema-demux
index 8e747de..74d00f7 100644
--- a/tests/ref/fate/d-cinema-demux
+++ b/tests/ref/fate/d-cinema-demux
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s24daud
 #sample_rate 0: 96000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 0,          0,          0,     1875,    36000, 0xd592781d
 0,       1875,       1875,     1875,    36000, 0xd592781d
 0,       3750,       3750,     1875,    36000, 0xd592781d
diff --git a/tests/ref/fate/dca-xll_51_16_192_768_0 b/tests/ref/fate/dca-xll_51_16_192_768_0
index acbae84..6e62c61 100644
--- a/tests/ref/fate/dca-xll_51_16_192_768_0
+++ b/tests/ref/fate/dca-xll_51_16_192_768_0
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 192000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
 0,       2048,       2048,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
diff --git a/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_2 b/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_2
index acbae84..6e62c61 100644
--- a/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_2
+++ b/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 192000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
 0,       2048,       2048,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
diff --git a/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_6 b/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_6
index acbae84..6e62c61 100644
--- a/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_6
+++ b/tests/ref/fate/dca-xll_51_16_192_768_0-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 192000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
 0,       2048,       2048,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
diff --git a/tests/ref/fate/dca-xll_51_16_192_768_1 b/tests/ref/fate/dca-xll_51_16_192_768_1
index acbae84..6e62c61 100644
--- a/tests/ref/fate/dca-xll_51_16_192_768_1
+++ b/tests/ref/fate/dca-xll_51_16_192_768_1
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 192000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
 0,       2048,       2048,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
diff --git a/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_2 b/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_2
index 3486971..17896a7 100644
--- a/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_2
+++ b/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 192000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     2048,     8192, 0829f71740aab1ab98b33eae21dee122
 0,       2048,       2048,     2048,     8192, c8ca1cff44674809d464ec39cf1bd1e9
diff --git a/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_6 b/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_6
index acbae84..6e62c61 100644
--- a/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_6
+++ b/tests/ref/fate/dca-xll_51_16_192_768_1-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 192000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
 0,       2048,       2048,     2048,    24576, 91ff0dac5df86e798bfef5e573536b08
diff --git a/tests/ref/fate/dca-xll_51_24_48_768 b/tests/ref/fate/dca-xll_51_24_48_768
index 8e7be8b..2d10583 100644
--- a/tests/ref/fate/dca-xll_51_24_48_768
+++ b/tests/ref/fate/dca-xll_51_24_48_768
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
 0,        512,        512,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
diff --git a/tests/ref/fate/dca-xll_51_24_48_768-dmix_2 b/tests/ref/fate/dca-xll_51_24_48_768-dmix_2
index 5f57619..be22d7d 100644
--- a/tests/ref/fate/dca-xll_51_24_48_768-dmix_2
+++ b/tests/ref/fate/dca-xll_51_24_48_768-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     3072, d2a70550489de356a2cd6bfc40711204
 0,        512,        512,      512,     3072, d2a70550489de356a2cd6bfc40711204
diff --git a/tests/ref/fate/dca-xll_51_24_48_768-dmix_6 b/tests/ref/fate/dca-xll_51_24_48_768-dmix_6
index 8e7be8b..2d10583 100644
--- a/tests/ref/fate/dca-xll_51_24_48_768-dmix_6
+++ b/tests/ref/fate/dca-xll_51_24_48_768-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
 0,        512,        512,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
diff --git a/tests/ref/fate/dca-xll_51_24_48_none b/tests/ref/fate/dca-xll_51_24_48_none
index a1994e7..17cfd0e 100644
--- a/tests/ref/fate/dca-xll_51_24_48_none
+++ b/tests/ref/fate/dca-xll_51_24_48_none
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
 0,       1024,       1024,     1024,    18432, 6707daa7724fdc552869e522a7936f26
diff --git a/tests/ref/fate/dca-xll_51_24_48_none-dmix_2 b/tests/ref/fate/dca-xll_51_24_48_none-dmix_2
index a1994e7..17cfd0e 100644
--- a/tests/ref/fate/dca-xll_51_24_48_none-dmix_2
+++ b/tests/ref/fate/dca-xll_51_24_48_none-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
 0,       1024,       1024,     1024,    18432, 6707daa7724fdc552869e522a7936f26
diff --git a/tests/ref/fate/dca-xll_51_24_48_none-dmix_6 b/tests/ref/fate/dca-xll_51_24_48_none-dmix_6
index a1994e7..17cfd0e 100644
--- a/tests/ref/fate/dca-xll_51_24_48_none-dmix_6
+++ b/tests/ref/fate/dca-xll_51_24_48_none-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
 0,       1024,       1024,     1024,    18432, 6707daa7724fdc552869e522a7936f26
diff --git a/tests/ref/fate/dca-xll_71_24_48_768_0 b/tests/ref/fate/dca-xll_71_24_48_768_0
index 387b07e..a295d41 100644
--- a/tests/ref/fate/dca-xll_71_24_48_768_0
+++ b/tests/ref/fate/dca-xll_71_24_48_768_0
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 63f
+#channel_layout_name 0: 7.1
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,    12288, ca9f8c8eb1b9b311cb79999fa376c7f0
 0,        512,        512,      512,    12288, 4072783b8efb99a9e5817067d68f61c6
diff --git a/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_2 b/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_2
index e1169e1..f9b7b65 100644
--- a/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_2
+++ b/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     9216, a2b724b146069938f0e2cb82490dea54
 0,        512,        512,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
diff --git a/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_6 b/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_6
index e1169e1..f9b7b65 100644
--- a/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_6
+++ b/tests/ref/fate/dca-xll_71_24_48_768_0-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     9216, a2b724b146069938f0e2cb82490dea54
 0,        512,        512,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
diff --git a/tests/ref/fate/dca-xll_71_24_48_768_1 b/tests/ref/fate/dca-xll_71_24_48_768_1
index 387b07e..a295d41 100644
--- a/tests/ref/fate/dca-xll_71_24_48_768_1
+++ b/tests/ref/fate/dca-xll_71_24_48_768_1
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 63f
+#channel_layout_name 0: 7.1
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,    12288, ca9f8c8eb1b9b311cb79999fa376c7f0
 0,        512,        512,      512,    12288, 4072783b8efb99a9e5817067d68f61c6
diff --git a/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_2 b/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_2
index 44bc5a0..5b01746 100644
--- a/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_2
+++ b/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     3072, d2a70550489de356a2cd6bfc40711204
 0,        512,        512,      512,     3072, d2a70550489de356a2cd6bfc40711204
diff --git a/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_6 b/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_6
index ef6a113..246b5e0 100644
--- a/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_6
+++ b/tests/ref/fate/dca-xll_71_24_48_768_1-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     9216, a2b724b146069938f0e2cb82490dea54
 0,        512,        512,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
diff --git a/tests/ref/fate/dca-xll_71_24_96_768 b/tests/ref/fate/dca-xll_71_24_96_768
index a2a02e0..418b4b1 100644
--- a/tests/ref/fate/dca-xll_71_24_96_768
+++ b/tests/ref/fate/dca-xll_71_24_96_768
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 96000
 #channel_layout 0: 63f
+#channel_layout_name 0: 7.1
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    24576, 0b24a527d66f2b0cab97f37e4cd79987
 0,       1024,       1024,     1024,    24576, 91ff0dac5df86e798bfef5e573536b08
diff --git a/tests/ref/fate/dca-xll_71_24_96_768-dmix_2 b/tests/ref/fate/dca-xll_71_24_96_768-dmix_2
index 9f2877d..9bd0256 100644
--- a/tests/ref/fate/dca-xll_71_24_96_768-dmix_2
+++ b/tests/ref/fate/dca-xll_71_24_96_768-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 96000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, 0a675f172b0e1a171c46dfaa4f1d0f00
 0,       1024,       1024,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
diff --git a/tests/ref/fate/dca-xll_71_24_96_768-dmix_6 b/tests/ref/fate/dca-xll_71_24_96_768-dmix_6
index 9f2877d..9bd0256 100644
--- a/tests/ref/fate/dca-xll_71_24_96_768-dmix_6
+++ b/tests/ref/fate/dca-xll_71_24_96_768-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 96000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, 0a675f172b0e1a171c46dfaa4f1d0f00
 0,       1024,       1024,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
diff --git a/tests/ref/fate/dca-xll_x96_51_24_96_1509 b/tests/ref/fate/dca-xll_x96_51_24_96_1509
index 39a9e79..bc83f79 100644
--- a/tests/ref/fate/dca-xll_x96_51_24_96_1509
+++ b/tests/ref/fate/dca-xll_x96_51_24_96_1509
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 96000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
 0,       1024,       1024,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
diff --git a/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_2 b/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_2
index 39a9e79..bc83f79 100644
--- a/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_2
+++ b/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 96000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
 0,       1024,       1024,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
diff --git a/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_6 b/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_6
index 39a9e79..bc83f79 100644
--- a/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_6
+++ b/tests/ref/fate/dca-xll_x96_51_24_96_1509-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 96000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
 0,       1024,       1024,     1024,    18432, f9debe3f07be68533bf0295e3d2ba68a
diff --git a/tests/ref/fate/dca-xll_xch_61_24_48_768 b/tests/ref/fate/dca-xll_xch_61_24_48_768
index e3ac859..19816d9 100644
--- a/tests/ref/fate/dca-xll_xch_61_24_48_768
+++ b/tests/ref/fate/dca-xll_xch_61_24_48_768
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 70f
+#channel_layout_name 0: 6.1
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,    10752, c3c5b236c266a9090378def1ad497a21
 0,        512,        512,      512,    10752, 36eb6749f8d9ce9f94860dcc447253ac
diff --git a/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_2 b/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_2
index b53a528..1f6989f 100644
--- a/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_2
+++ b/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_2
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     9216, 652c4e61f9abe9fba9de792242e2d31d
 0,        512,        512,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
diff --git a/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_6 b/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_6
index b53a528..1f6989f 100644
--- a/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_6
+++ b/tests/ref/fate/dca-xll_xch_61_24_48_768-dmix_6
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s24le
 #sample_rate 0: 48000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      512,     9216, 652c4e61f9abe9fba9de792242e2d31d
 0,        512,        512,      512,     9216, 13a95890b5f0947d6f058ca9c30a3e01
diff --git a/tests/ref/fate/dcinema-encode b/tests/ref/fate/dcinema-encode
index 27865d6..03e6e6e 100644
--- a/tests/ref/fate/dcinema-encode
+++ b/tests/ref/fate/dcinema-encode
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 96000
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,      341,     4092, 697cddfcd0e21f24782af0705b7048f3
 0,        341,        341,      341,     4092, a057b18cd493923fed33c18578f61e0b
diff --git a/tests/ref/fate/delphine-cin-audio b/tests/ref/fate/delphine-cin-audio
index 5a69640..6fdc804 100644
--- a/tests/ref/fate/delphine-cin-audio
+++ b/tests/ref/fate/delphine-cin-audio
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,    88224,   176448, 0x541ddc55
 0,      88224,      88224,     1838,     3676, 0xaf455081
 0,      90062,      90062,     1838,     3676, 0x27ef4e91
diff --git a/tests/ref/fate/dpcm-idroq b/tests/ref/fate/dpcm-idroq
index 39f2c79..fb45ace 100644
--- a/tests/ref/fate/dpcm-idroq
+++ b/tests/ref/fate/dpcm-idroq
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     7456,    29824, 0x77e265b7
 0,       7456,       7456,      736,     2944, 0x8dcdf50b
 0,       8192,       8192,      736,     2944, 0xb135cd2a
diff --git a/tests/ref/fate/dpcm-interplay b/tests/ref/fate/dpcm-interplay
index 87a2862..720a98f 100644
--- a/tests/ref/fate/dpcm-interplay
+++ b/tests/ref/fate/dpcm-interplay
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1462,     5848, 0xea04292b
 0,       1462,       1462,     1472,     5888, 0x0e59e942
 0,       2934,       2934,     1472,     5888, 0x56d480f6
diff --git a/tests/ref/fate/dss-lp b/tests/ref/fate/dss-lp
index 6b5a7db..ab1d534 100644
--- a/tests/ref/fate/dss-lp
+++ b/tests/ref/fate/dss-lp
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0xf1107658
 0,        240,        240,      240,      480, 0x50dee179
 0,        480,        480,      240,      480, 0x40090802
diff --git a/tests/ref/fate/dss-sp b/tests/ref/fate/dss-sp
index 5caa469..f407ce7 100644
--- a/tests/ref/fate/dss-sp
+++ b/tests/ref/fate/dss-sp
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 11025
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      264,      528, 0xa2579e96
 0,        264,        264,      264,      528, 0xf9b23172
 0,        528,        528,      264,      528, 0x5571a0fe
diff --git a/tests/ref/fate/ffmpeg-filter_colorkey b/tests/ref/fate/ffmpeg-filter_colorkey
index 9fbdfeb..1f96f2d 100644
--- a/tests/ref/fate/ffmpeg-filter_colorkey
+++ b/tests/ref/fate/ffmpeg-filter_colorkey
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,   622080, 0x4e30accb
 1,          0,          0,     1152,     4608, 0x00000000
 1,       1152,       1152,     1152,     4608, 0xbca29063
diff --git a/tests/ref/fate/filter-acrossfade b/tests/ref/fate/filter-acrossfade
index b89f25d..0567b02 100644
--- a/tests/ref/fate/filter-acrossfade
+++ b/tests/ref/fate/filter-acrossfade
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,      888,     3552, 0x592ce6cc
 0,        888,        888,     1024,     4096, 0x20f6f6a9
 0,       1912,       1912,     1024,     4096, 0x3f840122
diff --git a/tests/ref/fate/filter-adelay b/tests/ref/fate/filter-adelay
index a03f516..e3ff763 100644
--- a/tests/ref/fate/filter-adelay
+++ b/tests/ref/fate/filter-adelay
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x9d7bf760
 0,       1024,       1024,     1024,     4096, 0xdf42c46b
 0,       2048,       2048,     1024,     4096, 0x2214fd20
diff --git a/tests/ref/fate/filter-aecho b/tests/ref/fate/filter-aecho
index f564fcc..2c88c37 100644
--- a/tests/ref/fate/filter-aecho
+++ b/tests/ref/fate/filter-aecho
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x3019edd5
 0,       1024,       1024,     1024,     4096, 0x2df2fe2f
 0,       2048,       2048,     1024,     4096, 0xde37ff37
diff --git a/tests/ref/fate/filter-aemphasis-50fm b/tests/ref/fate/filter-aemphasis-50fm
index bae123c..649cd44 100644
--- a/tests/ref/fate/filter-aemphasis-50fm
+++ b/tests/ref/fate/filter-aemphasis-50fm
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0xb9c5fefd
 0,       1024,       1024,     1024,     4096, 0xb2ae0a90
 0,       2048,       2048,     1024,     4096, 0x97e6e9f3
diff --git a/tests/ref/fate/filter-aemphasis-75kf b/tests/ref/fate/filter-aemphasis-75kf
index c40a389..5705e98 100644
--- a/tests/ref/fate/filter-aemphasis-75kf
+++ b/tests/ref/fate/filter-aemphasis-75kf
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x7b2101ec
 0,       1024,       1024,     1024,     4096, 0x5c16fc93
 0,       2048,       2048,     1024,     4096, 0x62bdee5d
diff --git a/tests/ref/fate/filter-afade-esin b/tests/ref/fate/filter-afade-esin
index b02c7ff..f9b910c 100644
--- a/tests/ref/fate/filter-afade-esin
+++ b/tests/ref/fate/filter-afade-esin
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x06e0d68a
 0,       1024,       1024,     1024,     4096, 0xb325d915
 0,       2048,       2048,     1024,     4096, 0xc0a5f1f1
diff --git a/tests/ref/fate/filter-afade-exp b/tests/ref/fate/filter-afade-exp
index f98db38..a0c519c 100644
--- a/tests/ref/fate/filter-afade-exp
+++ b/tests/ref/fate/filter-afade-exp
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x00000000
 0,       1024,       1024,     1024,     4096, 0x00000000
 0,       2048,       2048,     1024,     4096, 0x00000000
diff --git a/tests/ref/fate/filter-afade-hsin b/tests/ref/fate/filter-afade-hsin
index 7e51a8c..2c6a0e3 100644
--- a/tests/ref/fate/filter-afade-hsin
+++ b/tests/ref/fate/filter-afade-hsin
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x2042232e
 0,       1024,       1024,     1024,     4096, 0x2c073cf7
 0,       2048,       2048,     1024,     4096, 0x92fecae5
diff --git a/tests/ref/fate/filter-afade-iqsin b/tests/ref/fate/filter-afade-iqsin
index aa7eea7..fc22baf 100644
--- a/tests/ref/fate/filter-afade-iqsin
+++ b/tests/ref/fate/filter-afade-iqsin
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x220e908d
 0,       1024,       1024,     1024,     4096, 0xdd65002e
 0,       2048,       2048,     1024,     4096, 0x8072fb25
diff --git a/tests/ref/fate/filter-afade-log b/tests/ref/fate/filter-afade-log
index 03d5794..99ac0b3 100644
--- a/tests/ref/fate/filter-afade-log
+++ b/tests/ref/fate/filter-afade-log
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0xf01adbd3
 0,       1024,       1024,     1024,     4096, 0xbbe10f8e
 0,       2048,       2048,     1024,     4096, 0xbf04fccf
diff --git a/tests/ref/fate/filter-afade-qsin b/tests/ref/fate/filter-afade-qsin
index a6586b1..026fbbc 100644
--- a/tests/ref/fate/filter-afade-qsin
+++ b/tests/ref/fate/filter-afade-qsin
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0xd977ce0f
 0,       1024,       1024,     1024,     4096, 0x9333f5b1
 0,       2048,       2048,     1024,     4096, 0xf1a30794
diff --git a/tests/ref/fate/filter-agate b/tests/ref/fate/filter-agate
index 4f7b10e..b6e732a 100644
--- a/tests/ref/fate/filter-agate
+++ b/tests/ref/fate/filter-agate
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x1af20090
 0,       1024,       1024,     1024,     4096, 0x0b05ef2d
 0,       2048,       2048,     1024,     4096, 0x574bf11d
diff --git a/tests/ref/fate/filter-alimiter b/tests/ref/fate/filter-alimiter
index 06e23f1..aef9765 100644
--- a/tests/ref/fate/filter-alimiter
+++ b/tests/ref/fate/filter-alimiter
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0xd4194af4
 0,       1024,       1024,     1024,     4096, 0x686af4ab
 0,       2048,       2048,     1024,     4096, 0xe80cee61
diff --git a/tests/ref/fate/filter-amerge b/tests/ref/fate/filter-amerge
index 006383a..b3e5eb5 100644
--- a/tests/ref/fate/filter-amerge
+++ b/tests/ref/fate/filter-amerge
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     2048,     8192, 0x120efa65
 0,       2048,       2048,     2048,     8192, 0x7b3cebf7
 0,       4096,       4096,     2048,     8192, 0x0fb8ee01
diff --git a/tests/ref/fate/filter-anequalizer b/tests/ref/fate/filter-anequalizer
index 21c7aaf..caed836 100644
--- a/tests/ref/fate/filter-anequalizer
+++ b/tests/ref/fate/filter-anequalizer
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x8e1bf8e0
 0,       1024,       1024,     1024,     4096, 0xe315f564
 0,       2048,       2048,     1024,     4096, 0x3d0efa98
diff --git a/tests/ref/fate/filter-apad b/tests/ref/fate/filter-apad
index 194a459..9bf662d 100644
--- a/tests/ref/fate/filter-apad
+++ b/tests/ref/fate/filter-apad
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x29e3eecf
 0,       1024,       1024,     1024,     4096, 0x18390b96
 0,       2048,       2048,     1024,     4096, 0xc477fa99
diff --git a/tests/ref/fate/filter-asetnsamples b/tests/ref/fate/filter-asetnsamples
index 5e246ec..23cf11b 100644
--- a/tests/ref/fate/filter-asetnsamples
+++ b/tests/ref/fate/filter-asetnsamples
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,      512,     2048, 0xd2dbf701
 0,        512,        512,      512,     2048, 0xdb22f7bf
 0,       1024,       1024,      512,     2048, 0x82a103be
diff --git a/tests/ref/fate/filter-asetrate b/tests/ref/fate/filter-asetrate
index e4487ae..6ffa940 100644
--- a/tests/ref/fate/filter-asetrate
+++ b/tests/ref/fate/filter-asetrate
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 20000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x29e3eecf
 0,       1024,       1024,     1024,     4096, 0x18390b96
 0,       2048,       2048,     1024,     4096, 0xc477fa99
diff --git a/tests/ref/fate/filter-atrim-duration b/tests/ref/fate/filter-atrim-duration
index 6f16c8f..fafda17 100644
--- a/tests/ref/fate/filter-atrim-duration
+++ b/tests/ref/fate/filter-atrim-duration
@@ -3,4 +3,5 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,       4410,       4410,      441,     1764, 0x61e374f7
diff --git a/tests/ref/fate/filter-atrim-mixed b/tests/ref/fate/filter-atrim-mixed
index 8f8b4ed..4cd1d80 100644
--- a/tests/ref/fate/filter-atrim-mixed
+++ b/tests/ref/fate/filter-atrim-mixed
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,       1025,       1025,     1023,     4092, 0x78560a4c
 0,       2048,       2048,     1024,     4096, 0xc477fa99
 0,       3072,       3072,     1024,     4096, 0x3bc0f14f
diff --git a/tests/ref/fate/filter-atrim-samples b/tests/ref/fate/filter-atrim-samples
index 4dcb333..2d8c9a5 100644
--- a/tests/ref/fate/filter-atrim-samples
+++ b/tests/ref/fate/filter-atrim-samples
@@ -3,4 +3,5 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,         26,         26,       54,      216, 0x6b376c6c
diff --git a/tests/ref/fate/filter-atrim-time b/tests/ref/fate/filter-atrim-time
index 4ca3d73..a0c626c 100644
--- a/tests/ref/fate/filter-atrim-time
+++ b/tests/ref/fate/filter-atrim-time
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,       4410,       4410,      710,     2840, 0x658982a3
 0,       5120,       5120,     1024,     4096, 0xfd6a0070
 0,       6144,       6144,     1024,     4096, 0x0b01f4cf
diff --git a/tests/ref/fate/filter-chorus b/tests/ref/fate/filter-chorus
index 3fc4d73..211e60e 100644
--- a/tests/ref/fate/filter-chorus
+++ b/tests/ref/fate/filter-chorus
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,     2048,     4096, 0x1fc6f1f1
 0,       2048,       2048,     2048,     4096, 0xe5f7f442
 0,       4096,       4096,     2048,     4096, 0x4f14ecb9
diff --git a/tests/ref/fate/filter-compand b/tests/ref/fate/filter-compand
index 14fe0b2..ac9095f 100644
--- a/tests/ref/fate/filter-compand
+++ b/tests/ref/fate/filter-compand
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0xfc10e61b
 0,       1024,       1024,     1024,     4096, 0x8801ef13
 0,       2048,       2048,     1024,     4096, 0xba55fc17
diff --git a/tests/ref/fate/filter-concat b/tests/ref/fate/filter-concat
index f8f7353..022697e 100644
--- a/tests/ref/fate/filter-concat
+++ b/tests/ref/fate/filter-concat
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 44100
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   230400, 0x88c4d19a
 1,          0,          0,     1024,     2048, 0xb3f10192
 1,       1024,       1024,     1024,     2048, 0xb340fe4e
diff --git a/tests/ref/fate/filter-dcshift b/tests/ref/fate/filter-dcshift
index d04aa92..dad3df3 100644
--- a/tests/ref/fate/filter-dcshift
+++ b/tests/ref/fate/filter-dcshift
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x96868842
 0,       1024,       1024,     1024,     4096, 0xeff98700
 0,       2048,       2048,     1024,     4096, 0x6ea28e1e
diff --git a/tests/ref/fate/filter-earwax b/tests/ref/fate/filter-earwax
index 8d4eaa8..855f579 100644
--- a/tests/ref/fate/filter-earwax
+++ b/tests/ref/fate/filter-earwax
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x900af751
 0,       1024,       1024,     1024,     4096, 0xad570065
 0,       2048,       2048,     1024,     4096, 0x93d5f494
diff --git a/tests/ref/fate/filter-extrastereo b/tests/ref/fate/filter-extrastereo
index e43de2d..179c167 100644
--- a/tests/ref/fate/filter-extrastereo
+++ b/tests/ref/fate/filter-extrastereo
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x29e3eecf
 0,       1024,       1024,     1024,     4096, 0x18390b96
 0,       2048,       2048,     1024,     4096, 0xc477fa99
diff --git a/tests/ref/fate/filter-hls b/tests/ref/fate/filter-hls
index 47bc514..f68b42e 100644
--- a/tests/ref/fate/filter-hls
+++ b/tests/ref/fate/filter-hls
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,     1152,     2304, 0x907cb7fa
 0,       1152,       1152,     1152,     2304, 0xb8dc7525
 0,       2304,       2304,     1152,     2304, 0x3e7d6905
diff --git a/tests/ref/fate/filter-hls-append b/tests/ref/fate/filter-hls-append
index 4a88b86..759a2fb 100644
--- a/tests/ref/fate/filter-hls-append
+++ b/tests/ref/fate/filter-hls-append
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,     1152,     2304, 0x593ea430
 0,       1152,       1152,     1152,     2304, 0xde328304
 0,       2304,       2304,     1152,     2304, 0x12f673c9
diff --git a/tests/ref/fate/filter-meta-4560-rotate0 b/tests/ref/fate/filter-meta-4560-rotate0
index 6e870c7..97552ff 100644
--- a/tests/ref/fate/filter-meta-4560-rotate0
+++ b/tests/ref/fate/filter-meta-4560-rotate0
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 44100
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   195840, 0x0602351d
 1,          0,          0,     1024,     2048, 0x00000000
 1,       1024,       1024,     1024,     2048, 0xe6b00ffc
diff --git a/tests/ref/fate/filter-overlay-dvdsub-2397 b/tests/ref/fate/filter-overlay-dvdsub-2397
index 0e0444d..b86a218 100644
--- a/tests/ref/fate/filter-overlay-dvdsub-2397
+++ b/tests/ref/fate/filter-overlay-dvdsub-2397
@@ -8,6 +8,7 @@ 
 #codec_id 1: dts
 #sample_rate 1: 48000
 #channel_layout 1: 60f
+#channel_layout_name 1: 5.1(side)
 0,          0,          0,        1,   518400, 0x6b05d48a
 1,         27,         27,       10,     2013, 0x68e7b03a
 0,          1,          1,        1,   518400, 0x2c2219cd
diff --git a/tests/ref/fate/filter-silenceremove b/tests/ref/fate/filter-silenceremove
index 43360e8..81647c6 100644
--- a/tests/ref/fate/filter-silenceremove
+++ b/tests/ref/fate/filter-silenceremove
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 192000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,        1,        4, 0x00200008
 0,          1,          1,        1,        4, 0x00180006
 0,          2,          2,        1,        4, 0x001c0007
diff --git a/tests/ref/fate/filter-stereotools b/tests/ref/fate/filter-stereotools
index 89babd6..60acaf8 100644
--- a/tests/ref/fate/filter-stereotools
+++ b/tests/ref/fate/filter-stereotools
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x48b6d241
 0,       1024,       1024,     1024,     4096, 0xe0c4ca9a
 0,       2048,       2048,     1024,     4096, 0x6dd8e26c
diff --git a/tests/ref/fate/filter-tremolo b/tests/ref/fate/filter-tremolo
index ed0e662..c6cff52 100644
--- a/tests/ref/fate/filter-tremolo
+++ b/tests/ref/fate/filter-tremolo
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1024,     4096, 0x5d3be907
 0,       1024,       1024,     1024,     4096, 0xea151fbe
 0,       2048,       2048,     1024,     4096, 0xa5bc19f4
diff --git a/tests/ref/fate/flv-demux b/tests/ref/fate/flv-demux
index 0a4598c..4a79175 100644
--- a/tests/ref/fate/flv-demux
+++ b/tests/ref/fate/flv-demux
@@ -10,6 +10,7 @@ 
 #codec_id 1: aac
 #sample_rate 1: 22050
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,       33,      135, 0x78b33078, S=1,       39, 0xf8aa0d44
 1,          0,          0,       46,        9, 0x07bc01b8, S=1,        2, 0x00b600a3
 0,         33,         33,       33,       92, 0x0d891dd0, F=0x0
diff --git a/tests/ref/fate/g722-encode b/tests/ref/fate/g722-encode
index ddf97c9..d84d627 100644
--- a/tests/ref/fate/g722-encode
+++ b/tests/ref/fate/g722-encode
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 16000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     8192,    16384, 1dd9c285eb608038f3257d1a8e02eb75
 0,       8192,       8192,     8192,    16384, f7459334cbe70c06bc0897edfe64e840
diff --git a/tests/ref/fate/g722dec-1 b/tests/ref/fate/g722dec-1
index b7ec0d3..a97fc81 100644
--- a/tests/ref/fate/g722dec-1
+++ b/tests/ref/fate/g722dec-1
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 16000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,     2048,     4096, 0x4f9228b3
 0,       2048,       2048,     2048,     4096, 0xfab58157
 0,       4096,       4096,     2048,     4096, 0x0b641c78
diff --git a/tests/ref/fate/g723_1-dec-1 b/tests/ref/fate/g723_1-dec-1
index 01176fd..f7daad1 100644
--- a/tests/ref/fate/g723_1-dec-1
+++ b/tests/ref/fate/g723_1-dec-1
@@ -3,5 +3,6 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0x7f6f3970
 0,        240,        240,      240,      480, 0x1105a0d3
diff --git a/tests/ref/fate/g723_1-dec-2 b/tests/ref/fate/g723_1-dec-2
index 0711ae4..a403e56 100644
--- a/tests/ref/fate/g723_1-dec-2
+++ b/tests/ref/fate/g723_1-dec-2
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0x5d9d9091
 0,        240,        240,      240,      480, 0x425095b7
 0,        480,        480,      240,      480, 0xe7b6a1a7
diff --git a/tests/ref/fate/g723_1-dec-3 b/tests/ref/fate/g723_1-dec-3
index c1dde0c..e3d3978 100644
--- a/tests/ref/fate/g723_1-dec-3
+++ b/tests/ref/fate/g723_1-dec-3
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0xce908869
 0,        240,        240,      240,      480, 0xfa63588e
 0,        480,        480,      240,      480, 0x11ce850c
diff --git a/tests/ref/fate/g723_1-dec-4 b/tests/ref/fate/g723_1-dec-4
index 34817ee..309b3af 100644
--- a/tests/ref/fate/g723_1-dec-4
+++ b/tests/ref/fate/g723_1-dec-4
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0xa697b314
 0,        240,        240,      240,      480, 0x43c5dc5a
 0,        480,        480,      240,      480, 0xd2438147
diff --git a/tests/ref/fate/g723_1-dec-5 b/tests/ref/fate/g723_1-dec-5
index 7076fac..9e37c86 100644
--- a/tests/ref/fate/g723_1-dec-5
+++ b/tests/ref/fate/g723_1-dec-5
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0x4dce9773
 0,        240,        240,      240,      480, 0xe6367ab8
 0,        480,        480,      240,      480, 0xf36a589d
diff --git a/tests/ref/fate/g723_1-dec-6 b/tests/ref/fate/g723_1-dec-6
index b493b37..a51e8df 100644
--- a/tests/ref/fate/g723_1-dec-6
+++ b/tests/ref/fate/g723_1-dec-6
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0x4fa1aed9
 0,        240,        240,      240,      480, 0x6d7ef391
 0,        480,        480,      240,      480, 0xaecaf2c1
diff --git a/tests/ref/fate/g723_1-dec-7 b/tests/ref/fate/g723_1-dec-7
index bd960f5..db0ceb8 100644
--- a/tests/ref/fate/g723_1-dec-7
+++ b/tests/ref/fate/g723_1-dec-7
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0x35e4a1fd
 0,        240,        240,      240,      480, 0x2f7bdd60
 0,        480,        480,      240,      480, 0x0407e499
diff --git a/tests/ref/fate/g723_1-dec-8 b/tests/ref/fate/g723_1-dec-8
index 3399d7a..740ed2b 100644
--- a/tests/ref/fate/g723_1-dec-8
+++ b/tests/ref/fate/g723_1-dec-8
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      240,      480, 0x17930e0f
 0,        240,        240,      240,      480, 0x7c7f4247
 0,        480,        480,      240,      480, 0xbf3489e5
diff --git a/tests/ref/fate/g726-encode-2bit b/tests/ref/fate/g726-encode-2bit
index fdb42ff..4a83c95 100644
--- a/tests/ref/fate/g726-encode-2bit
+++ b/tests/ref/fate/g726-encode-2bit
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,    16384,    32768, b28b116d2315323aeba6b66b58b7f4ed
 0,      16384,      16384,    16384,    32768, e9cfbebe99490bd4987341ee748291c4
diff --git a/tests/ref/fate/g726-encode-3bit b/tests/ref/fate/g726-encode-3bit
index 92ea73d..c551ae6 100644
--- a/tests/ref/fate/g726-encode-3bit
+++ b/tests/ref/fate/g726-encode-3bit
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,    10920,    21840, 517dd6d1ce566b998251f0d215fa69c0
 0,      10920,      10920,    10920,    21840, b0268e2bcc67acb524753790123c65fd
diff --git a/tests/ref/fate/g726-encode-4bit b/tests/ref/fate/g726-encode-4bit
index ce7e1cb..ea277e1 100644
--- a/tests/ref/fate/g726-encode-4bit
+++ b/tests/ref/fate/g726-encode-4bit
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     8192,    16384, a0cf3a0953adce1a1032a4fd2da00a52
 0,       8192,       8192,     8192,    16384, c750c1b76a203556dd60d73d261529e9
diff --git a/tests/ref/fate/g726-encode-5bit b/tests/ref/fate/g726-encode-5bit
index bd0946f..30c456e 100644
--- a/tests/ref/fate/g726-encode-5bit
+++ b/tests/ref/fate/g726-encode-5bit
@@ -6,6 +6,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 #stream#, dts,        pts, duration,     size, hash
 0,          0,          0,     6552,    13104, 6fe3f75df1262c5f956887de9c32df40
 0,       6552,       6552,     6552,    13104, f955518de6f61f94253280d11d64d68b
diff --git a/tests/ref/fate/gapless-mp3 b/tests/ref/fate/gapless-mp3
index ebe7bfa..3e60de7 100644
--- a/tests/ref/fate/gapless-mp3
+++ b/tests/ref/fate/gapless-mp3
@@ -1,5 +1,5 @@ 
-37534a3bcc3ef306e8c5ebfcfedfc41c *tests/data/fate/gapless-mp3.out-1
-c96c3ae7bd3300fd2f4debac222de5b7
-0cd1cdbcfd5cdbf6270cd98219bf31cd *tests/data/fate/gapless-mp3.out-2
-c96c3ae7bd3300fd2f4debac222de5b7
-9d3d8ba8a61b534f2d02ee648d6a8229 *tests/data/fate/gapless-mp3.out-3
+44b42cc3a898b45507d856d0813f4f26 *tests/data/fate/gapless-mp3.out-1
+c96c3ae7bd3300fd2f4debac222de5b7
+ec876434ed65e338e07234e54d136caf *tests/data/fate/gapless-mp3.out-2
+c96c3ae7bd3300fd2f4debac222de5b7
+806fd80eba887b46a1eba1eeff63df28 *tests/data/fate/gapless-mp3.out-3
diff --git a/tests/ref/fate/gsm-ms b/tests/ref/fate/gsm-ms
index 92d78f3..0acf9f6 100644
--- a/tests/ref/fate/gsm-ms
+++ b/tests/ref/fate/gsm-ms
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      320,      640, 0xf79c59ee
 0,        320,        320,      320,      640, 0x6e6248be
 0,        640,        640,      320,      640, 0x2a5b3aed
diff --git a/tests/ref/fate/gsm-toast b/tests/ref/fate/gsm-toast
index 46aab79..df5e824 100644
--- a/tests/ref/fate/gsm-toast
+++ b/tests/ref/fate/gsm-toast
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,       64,      128, 0x3ef33f6f
 0,         64,         64,      160,      320, 0x2052a4e7
 0,        224,        224,      160,      320, 0xe9aeafca
diff --git a/tests/ref/fate/h264-skip-nointra b/tests/ref/fate/h264-skip-nointra
index 40b5bb2..0259902 100644
--- a/tests/ref/fate/h264-skip-nointra
+++ b/tests/ref/fate/h264-skip-nointra
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 1,          0,          0,     1152,     4608, 0x00000000
 1,       1152,       1152,     1152,     4608, 0x00000000
 1,       2304,       2304,     1152,     4608, 0x00000000
diff --git a/tests/ref/fate/h264-skip-nokey b/tests/ref/fate/h264-skip-nokey
index 40b5bb2..0259902 100644
--- a/tests/ref/fate/h264-skip-nokey
+++ b/tests/ref/fate/h264-skip-nokey
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 1,          0,          0,     1152,     4608, 0x00000000
 1,       1152,       1152,     1152,     4608, 0x00000000
 1,       2304,       2304,     1152,     4608, 0x00000000
diff --git a/tests/ref/fate/h264-xavc-4389 b/tests/ref/fate/h264-xavc-4389
index b1158b8..5c76bc2 100644
--- a/tests/ref/fate/h264-xavc-4389
+++ b/tests/ref/fate/h264-xavc-4389
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,  8294400, 0x9a02ecf2
 1,          0,          0,     1920,     3840, 0x38074ac8
 0,          1,          1,        1,  8294400, 0x626f870a
diff --git a/tests/ref/fate/id-cin-video b/tests/ref/fate/id-cin-video
index 469e239..671b396 100644
--- a/tests/ref/fate/id-cin-video
+++ b/tests/ref/fate/id-cin-video
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 22050
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,   230400, 0x00000000
 1,          0,          0,     1575,     6300, 0xdd759df8
 0,          1,          1,        1,   230400, 0x3a3486b4
diff --git a/tests/ref/fate/jv-demux b/tests/ref/fate/jv-demux
index 280528c..bf821107 100644
--- a/tests/ref/fate/jv-demux
+++ b/tests/ref/fate/jv-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_u8
 #sample_rate 1: 22050
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,        6, 0x000a0003
 1,          0,          0,   131072,   131072, 0x14c664d6
 0,          1,          1,        1,      773, 0x11802a51
diff --git a/tests/ref/fate/lmlm4-demux b/tests/ref/fate/lmlm4-demux
index 79cb539..b0276d5 100644
--- a/tests/ref/fate/lmlm4-demux
+++ b/tests/ref/fate/lmlm4-demux
@@ -9,6 +9,7 @@ 
 #codec_id 1: mp2
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0, -9223372036854775808,        1,     5951, 0xe9118e0d
 1,          0,          0,     2160,      768, 0xaebcbebb
 1,       2160,       2160,     2160,      768, 0xaebcbebb
diff --git a/tests/ref/fate/maxis-xa b/tests/ref/fate/maxis-xa
index ae8124d..ad9d732 100644
--- a/tests/ref/fate/maxis-xa
+++ b/tests/ref/fate/maxis-xa
@@ -3,6 +3,7 @@ 
 #codec_id 0: adpcm_ea_maxis_xa
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,       28,       30, 0x51750711
 0,         28,         28,       28,       30, 0x9ca20c2a
 0,         56,         56,       28,       30, 0x7551081f
diff --git a/tests/ref/fate/mkv b/tests/ref/fate/mkv
index 0e7f651..f9c3037 100644
--- a/tests/ref/fate/mkv
+++ b/tests/ref/fate/mkv
@@ -10,6 +10,7 @@ 
 #codec_id 1: aac
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,        -42,          0,       41,    63501, 0x139d4c99
 0,          0,         84,       41,     5368, 0xd964b678, F=0x0
 1,          8,          8,       21,      528, 0x3c990ddf
diff --git a/tests/ref/fate/mkv-1242 b/tests/ref/fate/mkv-1242
index 1ba41a0..34e5b4a 100644
--- a/tests/ref/fate/mkv-1242
+++ b/tests/ref/fate/mkv-1242
@@ -10,6 +10,7 @@ 
 #codec_id 1: aac
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,        -42,          0,       41,     2969, 0xa7016742
 0,          0,         42,       41,      135, 0x33af1a9e, F=0x0
 1,          0,          0,       21,        6, 0x027e00e8
diff --git a/tests/ref/fate/mov-mp3-demux b/tests/ref/fate/mov-mp3-demux
index fc96c58..1930960 100644
--- a/tests/ref/fate/mov-mp3-demux
+++ b/tests/ref/fate/mov-mp3-demux
@@ -3,6 +3,7 @@ 
 #codec_id 0: mp3
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1152,       36, 0x8e260589
 0,       1152,       1152,     1152,       36, 0x8e260589
 0,       2304,       2304,     1152,       36, 0x8e260589
diff --git a/tests/ref/fate/mtv b/tests/ref/fate/mtv
index 81711f7..7b17bc1 100644
--- a/tests/ref/fate/mtv
+++ b/tests/ref/fate/mtv
@@ -9,6 +9,7 @@ 
 #codec_id 1: mp3
 #sample_rate 1: 44100
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,    12288, 0xc2258ebc
 1,          0,          0,     1152,      417, 0xae1cc66a
 1,       1152,       1152,     1152,      418, 0xdc3ec850
diff --git a/tests/ref/fate/mxf-demux b/tests/ref/fate/mxf-demux
index 66dea10..906a6d0 100644
--- a/tests/ref/fate/mxf-demux
+++ b/tests/ref/fate/mxf-demux
@@ -9,6 +9,7 @@ 
 #codec_id 1: pcm_alaw
 #sample_rate 1: 8000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0, -9223372036854775808,        1,     8468, 0xc0855553
 1,          0,          0,    16000,    32000, 0x479155e6
 0,          1, -9223372036854775808,        1,     3814, 0xa10783b4, F=0x0
diff --git a/tests/ref/fate/nsv-demux b/tests/ref/fate/nsv-demux
index 7b9c000..bff871d 100644
--- a/tests/ref/fate/nsv-demux
+++ b/tests/ref/fate/nsv-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: mp3
 #sample_rate 1: 11025
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,       12, 0x1396035f
 0,          1,          1,        1,       24, 0x8ab80ac7, F=0x0
 0,          2,          2,        1,      208, 0x1de1603e, F=0x0
diff --git a/tests/ref/fate/oggopus-demux b/tests/ref/fate/oggopus-demux
index 4621af6..9192760 100644
--- a/tests/ref/fate/oggopus-demux
+++ b/tests/ref/fate/oggopus-demux
@@ -4,6 +4,7 @@ 
 #codec_id 0: opus
 #sample_rate 0: 48000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,       -356,       -356,      960,      402, 0x89b1c40f
 0,        604,        604,      960,      216, 0x7bf97146
 0,       1564,       1564,      960,      215, 0x6cb86d8b
diff --git a/tests/ref/fate/on2avc b/tests/ref/fate/on2avc
index 2125cc6..a9d6cbc 100644
--- a/tests/ref/fate/on2avc
+++ b/tests/ref/fate/on2avc
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 16000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,     1024,     2048, 0x00000000
 0,       1024,       1024,     1024,     2048, 0x96ee1301
 0,       2048,       2048,     1024,     2048, 0xe2a81605
diff --git a/tests/ref/fate/paf-audio b/tests/ref/fate/paf-audio
index bb93ad5..a9ed9e9 100644
--- a/tests/ref/fate/paf-audio
+++ b/tests/ref/fate/paf-audio
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,    57330,   229320, 0x062508b4
 0,      57330,      57330,    57330,   229320, 0x0a966cbf
 0,     114660,     114660,    57330,   229320, 0xee9bad45
diff --git a/tests/ref/fate/paf-demux b/tests/ref/fate/paf-demux
index 0f281fe..6a66697 100644
--- a/tests/ref/fate/paf-demux
+++ b/tests/ref/fate/paf-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: paf_audio
 #sample_rate 1: 22050
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,   262144, 0x7f9a3c6a
 1,          0,          0,    57330,   131072, 0x255a6ac2
 0,          1,          1,        1,   260600, 0x0329e6f4, F=0x0
diff --git a/tests/ref/fate/pcm-planar b/tests/ref/fate/pcm-planar
index 5339447..8b6c961 100644
--- a/tests/ref/fate/pcm-planar
+++ b/tests/ref/fate/pcm-planar
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1471,     5884, 0x00000000
 0,       1471,       1471,     1471,     5884, 0x00000000
 0,       2942,       2942,     1472,     5888, 0x00000000
diff --git a/tests/ref/fate/pcm_dvd b/tests/ref/fate/pcm_dvd
index 8aa87cd..2a24156 100644
--- a/tests/ref/fate/pcm_dvd
+++ b/tests/ref/fate/pcm_dvd
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 48000
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,      334,     1336, 0x8e3c0abc
 0,        400,        400,      334,     1336, 0x99c41108
 0,        720,        720,      334,     1336, 0xd65be322
diff --git a/tests/ref/fate/pmp-demux b/tests/ref/fate/pmp-demux
index 4b66427..5c51b8b 100644
--- a/tests/ref/fate/pmp-demux
+++ b/tests/ref/fate/pmp-demux
@@ -3,6 +3,7 @@ 
 #codec_id 0: mp3
 #sample_rate 0: 44100
 #channel_layout 0: 3
+#channel_layout_name 0: stereo
 0,          0,          0,     1152,      417, 0xcb873fba
 0,       1152,       1152,     1152,      104, 0x6d521c5a
 0,       2304,       2304,     1152,      104, 0xb3af1d64
diff --git a/tests/ref/fate/prores-gray b/tests/ref/fate/prores-gray
index 22b79b9..a1a63fa 100644
--- a/tests/ref/fate/prores-gray
+++ b/tests/ref/fate/prores-gray
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,  1658880, 0x43d9c9e2
 1,          0,          0,     1024,     4096, 0x6c8a9a18
 1,       1024,       1024,     1024,     4096, 0x960dadcf
diff --git a/tests/ref/fate/prores-transparency b/tests/ref/fate/prores-transparency
index 6a9c786..7b3efc6 100644
--- a/tests/ref/fate/prores-transparency
+++ b/tests/ref/fate/prores-transparency
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1, 16588800, 0x7163b01a
 1,          0,          0,     1024,     4096, 0x00000000
 1,       1024,       1024,      896,     3584, 0x00000000
diff --git a/tests/ref/fate/prores-transparency_skip b/tests/ref/fate/prores-transparency_skip
index 569d2ba..5c98d3e 100644
--- a/tests/ref/fate/prores-transparency_skip
+++ b/tests/ref/fate/prores-transparency_skip
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1, 12441600, 0x627d1548
 1,          0,          0,     1024,     4096, 0x00000000
 1,       1024,       1024,      896,     3584, 0x00000000
diff --git a/tests/ref/fate/psx-str-demux b/tests/ref/fate/psx-str-demux
index e346c52..a47c869 100644
--- a/tests/ref/fate/psx-str-demux
+++ b/tests/ref/fate/psx-str-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: adpcm_xa
 #sample_rate 1: 37800
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        1,     8832, 0x01ad3eeb
 1,          0,          0,        1,     2304, 0xf0ad1000
 1,          1,          1,        1,     2304, 0x69269ce6
diff --git a/tests/ref/fate/pva-demux b/tests/ref/fate/pva-demux
index 4059af4..3f1c74f 100644
--- a/tests/ref/fate/pva-demux
+++ b/tests/ref/fate/pva-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: mp2
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 1,          0,          0,     2160,      384, 0x071abcc8
 1,       2160,       2160,     2160,      384, 0x31c9aee0
 1,       4320,       4320,     2160,      384, 0xa50eaa94
diff --git a/tests/ref/fate/ra3-144 b/tests/ref/fate/ra3-144
index b5fb47b..75e7bbf 100644
--- a/tests/ref/fate/ra3-144
+++ b/tests/ref/fate/ra3-144
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 8000
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,      160,      320, 0x00000000
 0,        160,        160,      160,      320, 0x4cfd5d74
 0,        320,        320,      160,      320, 0xbb60fa3d
diff --git a/tests/ref/fate/redcode-demux b/tests/ref/fate/redcode-demux
index c08bbc8..45119ec 100644
--- a/tests/ref/fate/redcode-demux
+++ b/tests/ref/fate/redcode-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s32be
 #sample_rate 1: 48000
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,    10010,  1626280, 0x5768c7d6
 1,          0,          0,    18140,    14816, 0xd185e8c7
 0,      10010,      10010,    10010,  1626092, 0x070bd882
diff --git a/tests/ref/fate/sierra-vmd-audio b/tests/ref/fate/sierra-vmd-audio
index 2b9f8e8..9c0e6b2 100644
--- a/tests/ref/fate/sierra-vmd-audio
+++ b/tests/ref/fate/sierra-vmd-audio
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,    61740,   123480, 0x3a794c13
 0,      61740,      61740,     2205,     4410, 0x109d04e0
 0,      63945,      63945,     2205,     4410, 0x224d244f
diff --git a/tests/ref/fate/siff-demux b/tests/ref/fate/siff-demux
index 687a518..f8e9897 100644
--- a/tests/ref/fate/siff-demux
+++ b/tests/ref/fate/siff-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_u8
 #sample_rate 1: 22050
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,    15152, 0x14fc0f1f
 1,          0,          0,    22050,    22050, 0xa7d60d27
 0,          1,          1,        1,    15344, 0x31614bd7
diff --git a/tests/ref/fate/smacker-audio b/tests/ref/fate/smacker-audio
index fbeb4be..6b86787 100644
--- a/tests/ref/fate/smacker-audio
+++ b/tests/ref/fate/smacker-audio
@@ -3,6 +3,7 @@ 
 #codec_id 0: pcm_s16le
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,    23620,    47240, 0x9974897c
 0,      23620,      23620,     1564,     3128, 0x7e4064b4
 0,      25184,      25184,     1564,     3128, 0x80883301
diff --git a/tests/ref/fate/smjpeg-demux b/tests/ref/fate/smjpeg-demux
index 242a22f..042f9ff 100644
--- a/tests/ref/fate/smjpeg-demux
+++ b/tests/ref/fate/smjpeg-demux
@@ -8,6 +8,7 @@ 
 #codec_id 1: adpcm_ima_smjpeg
 #sample_rate 1: 22050
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        0,      734, 0x5a042c2c
 1,          0,          0,       23,      260, 0x00000000
 1,         23,         23,       23,      260, 0x00000000
diff --git a/tests/ref/fate/sp5x b/tests/ref/fate/sp5x
index 603535b..2ca7981 100644
--- a/tests/ref/fate/sp5x
+++ b/tests/ref/fate/sp5x
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 8000
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   115200, 0x8ebcb7f8
 1,          0,          0,     1024,     2048, 0x366ee71c
 0,          1,          1,        1,   115200, 0x1fa8e673
diff --git a/tests/ref/fate/tiertex-seq b/tests/ref/fate/tiertex-seq
index 3504dd4..1db906a 100644
--- a/tests/ref/fate/tiertex-seq
+++ b/tests/ref/fate/tiertex-seq
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 22050
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 1,          0,          0,      882,     1764, 0x00000000
 1,        882,        882,      882,     1764, 0x80a253d9
 0,          2,          2,        1,    98304, 0x2e5db4a4
diff --git a/tests/ref/fate/tmv b/tests/ref/fate/tmv
index 94437fa..09198fa 100644
--- a/tests/ref/fate/tmv
+++ b/tests/ref/fate/tmv
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 22058
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   192000, 0xc698297a
 1,          0,          0,      368,      736, 0xf63db497
 0,          1,          1,        1,   192000, 0x8d5bd6be
diff --git a/tests/ref/fate/ts-demux b/tests/ref/fate/ts-demux
index c66e907..e2931af 100644
--- a/tests/ref/fate/ts-demux
+++ b/tests/ref/fate/ts-demux
@@ -9,6 +9,7 @@ 
 #codec_id 1: ac3
 #sample_rate 1: 48000
 #channel_layout 1: 60f
+#channel_layout_name 1: 5.1(side)
 1,          0,          0,     2880,     1536, 0x773ffeea, S=1,        1, 0x00bd00bd
 1,       2880,       2880,     2880,     1536, 0x6dc10748
 1,       5760,       5760,     2880,     1536, 0xbab5129c
diff --git a/tests/ref/fate/ts-opus-demux b/tests/ref/fate/ts-opus-demux
index 9d2da43..3c5edff 100644
--- a/tests/ref/fate/ts-opus-demux
+++ b/tests/ref/fate/ts-opus-demux
@@ -4,6 +4,7 @@ 
 #codec_id 0: opus
 #sample_rate 0: 48000
 #channel_layout 0: 63f
+#channel_layout_name 0: 7.1
 0,          0,          0,     1800,      744, 0x172b615b, S=1,        1, 0x00bd00bd
 0,       1800,       1800,     1800,      743, 0x3f5b673d, S=1,        1, 0x00bd00bd
 0,       3600,       3600,     1800,      747, 0xe54e735d, S=1,        1, 0x00bd00bd
diff --git a/tests/ref/fate/tscc-15bit b/tests/ref/fate/tscc-15bit
index e854320..abfe6a6 100644
--- a/tests/ref/fate/tscc-15bit
+++ b/tests/ref/fate/tscc-15bit
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 11025
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   657600, 0x50b3a0c2
 1,          0,          0,    11025,    22050, 0x1740aaec
 0,          1,          1,        1,   657600, 0x50b3a0c2
diff --git a/tests/ref/fate/vqf-demux b/tests/ref/fate/vqf-demux
index 2d26a72..65836d8 100644
--- a/tests/ref/fate/vqf-demux
+++ b/tests/ref/fate/vqf-demux
@@ -1 +1 @@ 
-643ac05caf7ef16a8837933bf45281d5
+5f4cd9a6a8bea0040db6732a7830e9d7
diff --git a/tests/ref/fate/wav-ac3 b/tests/ref/fate/wav-ac3
index fd27f74..039e155 100644
--- a/tests/ref/fate/wav-ac3
+++ b/tests/ref/fate/wav-ac3
@@ -3,6 +3,7 @@ 
 #codec_id 0: ac3
 #sample_rate 0: 44100
 #channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
 0,          0,          0,     1536,     2786, 0xe2fd0f40
 0,       1536,       1536,     1536,     2786, 0x7a6207c2
 0,       3072,       3072,     1536,     2786, 0x7a6207c2
diff --git a/tests/ref/fate/wc3movie-xan b/tests/ref/fate/wc3movie-xan
index 5812503..052dbbc 100644
--- a/tests/ref/fate/wc3movie-xan
+++ b/tests/ref/fate/wc3movie-xan
@@ -8,6 +8,7 @@ 
 #codec_id 1: pcm_s16le
 #sample_rate 1: 22050
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        1,   158400, 0x25aec781
 1,          0,          0,     1470,     2940, 0x92cee2a6
 0,          1,          1,        1,   158400, 0xda4dbf70
diff --git a/tests/ref/fate/westwood-aud b/tests/ref/fate/westwood-aud
index fedcd5d..b719c50 100644
--- a/tests/ref/fate/westwood-aud
+++ b/tests/ref/fate/westwood-aud
@@ -3,6 +3,7 @@ 
 #codec_id 0: adpcm_ima_ws
 #sample_rate 0: 22050
 #channel_layout 0: 4
+#channel_layout_name 0: mono
 0,          0,          0,     1024,      512, 0x6694cc55
 0,       1024,       1024,     1024,      512, 0xdbc5cb22
 0,       2048,       2048,     1024,      512, 0x8e5bcbfd
diff --git a/tests/ref/fate/wmv8-drm-nodec b/tests/ref/fate/wmv8-drm-nodec
index 83aa92d..a46c338 100644
--- a/tests/ref/fate/wmv8-drm-nodec
+++ b/tests/ref/fate/wmv8-drm-nodec
@@ -10,6 +10,7 @@ 
 #codec_id 1: wmavoice
 #sample_rate 1: 22050
 #channel_layout 1: 4
+#channel_layout_name 1: mono
 0,          0,          0,        0,      282, 0x000d949a
 1,          0,          0,        0,     1088, 0x5cd379bb
 1,        435,        435,        0,     1088, 0x8dfa1368
diff --git a/tests/ref/fate/wtv-demux b/tests/ref/fate/wtv-demux
index 306fe00..abe85a4 100644
--- a/tests/ref/fate/wtv-demux
+++ b/tests/ref/fate/wtv-demux
@@ -10,6 +10,7 @@ 
 #codec_id 1: mp2
 #sample_rate 1: 48000
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 1,         -2,         -2,   240000,      576, 0x9b6e1638
 1,     239998,     239998,   240000,      576, 0x0ca91183
 1,     479998,     479998,   240000,      576, 0xec6a180f
diff --git a/tests/ref/fate/xmv-demux b/tests/ref/fate/xmv-demux
index 5840129..6da2b1a 100644
--- a/tests/ref/fate/xmv-demux
+++ b/tests/ref/fate/xmv-demux
@@ -9,6 +9,7 @@ 
 #codec_id 1: adpcm_ima_wav
 #sample_rate 1: 44100
 #channel_layout 1: 3
+#channel_layout_name 1: stereo
 0,          0,          0,        0,     1508, 0xefceba48
 1,          0,          0,       83,     5976, 0xfa2c2db9
 1,         83,         83,       83,     5976, 0x256b935c