History

af_channelmap: cosmetics, use an extra local variable to shorten the code

Anton Khirnov committed 13 years ago

Commit c0771a11 parent aafed111 file · +8 −7Browse files

Unified · Split

libavfilter/af_channelmap.c+8−7
@@ -362,24 +362,25 @@ static int channelmap_config_input(AVFilterLink *inlink) · 361 unmodified lines
362 char layout_name[256];362 char layout_name[256];
363 363
364 for (i = 0; i < s->nch; i++) {364 for (i = 0; i < s->nch; i++) {
365 struct ChannelMap *m = &s->map[i];
366
365 if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {367 if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) {
366 s->map[i].in_channel_idx = av_get_channel_layout_channel_index(368 m->in_channel_idx = av_get_channel_layout_channel_index(
367 inlink->channel_layout, s->map[i].in_channel);369 inlink->channel_layout, m->in_channel);
368 }370 }
369 371
370 if (s->map[i].in_channel_idx < 0 ||372 if (m->in_channel_idx < 0 || m->in_channel_idx >= nb_channels) {
371 s->map[i].in_channel_idx >= nb_channels) {
372 av_get_channel_layout_string(layout_name, sizeof(layout_name),373 av_get_channel_layout_string(layout_name, sizeof(layout_name),
373 0, inlink->channel_layout);374 0, inlink->channel_layout);
374 if (s->map[i].in_channel) {375 if (m->in_channel) {
375 channel_name = av_get_channel_name(s->map[i].in_channel);376 channel_name = av_get_channel_name(m->in_channel);
376 av_log(ctx, AV_LOG_ERROR,377 av_log(ctx, AV_LOG_ERROR,
377 "input channel '%s' not available from input layout '%s'\n",378 "input channel '%s' not available from input layout '%s'\n",
378 channel_name, layout_name);379 channel_name, layout_name);
379 } else {380 } else {
380 av_log(ctx, AV_LOG_ERROR,381 av_log(ctx, AV_LOG_ERROR,
381 "input channel #%d not available from input layout '%s'\n",382 "input channel #%d not available from input layout '%s'\n",
382 s->map[i].in_channel_idx, layout_name);383 m->in_channel_idx, layout_name);
383 }384 }
384 err = AVERROR(EINVAL);385 err = AVERROR(EINVAL);
385 }386 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t