mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit 'c0771a1ac6da697f86e3b10c8fe5dbc2ee92e347'
* commit 'c0771a1ac6da697f86e3b10c8fe5dbc2ee92e347': af_channelmap: cosmetics, use an extra local variable to shorten the code Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
f60ba6c524
@ -363,24 +363,25 @@ static int channelmap_config_input(AVFilterLink *inlink)
|
|||||||
char layout_name[256];
|
char layout_name[256];
|
||||||
|
|
||||||
for (i = 0; i < s->nch; i++) {
|
for (i = 0; i < s->nch; i++) {
|
||||||
|
struct ChannelMap *m = &s->map[i];
|
||||||
|
|
||||||
if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {
|
if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {
|
||||||
s->map[i].in_channel_idx = av_get_channel_layout_channel_index(
|
m->in_channel_idx = av_get_channel_layout_channel_index(
|
||||||
inlink->channel_layout, s->map[i].in_channel);
|
inlink->channel_layout, m->in_channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->map[i].in_channel_idx < 0 ||
|
if (m->in_channel_idx < 0 || m->in_channel_idx >= nb_channels) {
|
||||||
s->map[i].in_channel_idx >= nb_channels) {
|
|
||||||
av_get_channel_layout_string(layout_name, sizeof(layout_name),
|
av_get_channel_layout_string(layout_name, sizeof(layout_name),
|
||||||
0, inlink->channel_layout);
|
0, inlink->channel_layout);
|
||||||
if (s->map[i].in_channel) {
|
if (m->in_channel) {
|
||||||
channel_name = av_get_channel_name(s->map[i].in_channel);
|
channel_name = av_get_channel_name(m->in_channel);
|
||||||
av_log(ctx, AV_LOG_ERROR,
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
"input channel '%s' not available from input layout '%s'\n",
|
"input channel '%s' not available from input layout '%s'\n",
|
||||||
channel_name, layout_name);
|
channel_name, layout_name);
|
||||||
} else {
|
} else {
|
||||||
av_log(ctx, AV_LOG_ERROR,
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
"input channel #%d not available from input layout '%s'\n",
|
"input channel #%d not available from input layout '%s'\n",
|
||||||
s->map[i].in_channel_idx, layout_name);
|
m->in_channel_idx, layout_name);
|
||||||
}
|
}
|
||||||
err = AVERROR(EINVAL);
|
err = AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user