mirror of https://git.ffmpeg.org/ffmpeg.git
Map mlp surround channels to FFmpeg rear channels.
This allows more 3rd party applications to correctly read the resulting wav files.
This commit is contained in:
parent
a37f7b6246
commit
0aac0403c5
|
@ -47,24 +47,24 @@ const uint64_t ff_mlp_layout[32] = {
|
||||||
AV_CH_LAYOUT_MONO,
|
AV_CH_LAYOUT_MONO,
|
||||||
AV_CH_LAYOUT_STEREO,
|
AV_CH_LAYOUT_STEREO,
|
||||||
AV_CH_LAYOUT_2_1,
|
AV_CH_LAYOUT_2_1,
|
||||||
AV_CH_LAYOUT_2_2,
|
AV_CH_LAYOUT_QUAD,
|
||||||
AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_2_1|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_2_1|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_2_2|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_SURROUND,
|
AV_CH_LAYOUT_SURROUND,
|
||||||
AV_CH_LAYOUT_4POINT0,
|
AV_CH_LAYOUT_4POINT0,
|
||||||
AV_CH_LAYOUT_5POINT0,
|
AV_CH_LAYOUT_5POINT0_BACK,
|
||||||
AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_5POINT1,
|
AV_CH_LAYOUT_5POINT1_BACK,
|
||||||
AV_CH_LAYOUT_4POINT0,
|
AV_CH_LAYOUT_4POINT0,
|
||||||
AV_CH_LAYOUT_5POINT0,
|
AV_CH_LAYOUT_5POINT0_BACK,
|
||||||
AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_5POINT1,
|
AV_CH_LAYOUT_5POINT1_BACK,
|
||||||
AV_CH_LAYOUT_2_2|AV_CH_LOW_FREQUENCY,
|
AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY,
|
||||||
AV_CH_LAYOUT_5POINT0,
|
AV_CH_LAYOUT_5POINT0_BACK,
|
||||||
AV_CH_LAYOUT_5POINT1,
|
AV_CH_LAYOUT_5POINT1_BACK,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -459,13 +459,13 @@ static int read_restart_header(MLPDecodeContext *m, GetBitContext *gbp,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->avctx->codec_id == CODEC_ID_MLP && m->needs_reordering) {
|
if (m->avctx->codec_id == CODEC_ID_MLP && m->needs_reordering) {
|
||||||
if (m->avctx->channel_layout == (AV_CH_LAYOUT_2_2|AV_CH_LOW_FREQUENCY) ||
|
if (m->avctx->channel_layout == (AV_CH_LAYOUT_QUAD|AV_CH_LOW_FREQUENCY) ||
|
||||||
m->avctx->channel_layout == AV_CH_LAYOUT_5POINT0) {
|
m->avctx->channel_layout == AV_CH_LAYOUT_5POINT0_BACK) {
|
||||||
int i = s->ch_assign[4];
|
int i = s->ch_assign[4];
|
||||||
s->ch_assign[4] = s->ch_assign[3];
|
s->ch_assign[4] = s->ch_assign[3];
|
||||||
s->ch_assign[3] = s->ch_assign[2];
|
s->ch_assign[3] = s->ch_assign[2];
|
||||||
s->ch_assign[2] = i;
|
s->ch_assign[2] = i;
|
||||||
} else if (m->avctx->channel_layout == AV_CH_LAYOUT_5POINT1) {
|
} else if (m->avctx->channel_layout == AV_CH_LAYOUT_5POINT1_BACK) {
|
||||||
FFSWAP(int, s->ch_assign[2], s->ch_assign[4]);
|
FFSWAP(int, s->ch_assign[2], s->ch_assign[4]);
|
||||||
FFSWAP(int, s->ch_assign[3], s->ch_assign[5]);
|
FFSWAP(int, s->ch_assign[3], s->ch_assign[5]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue