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

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_channelmap.c+8−7
@@ -362,24 +362,25 @@ static int channelmap_config_input(AVFilterLink *inlink) · 361 unmodified lines
362362 char layout_name[256];
363363
364364 for (i = 0; i < s->nch; i++) {
365+ struct ChannelMap *m = &s->map[i];
366+
365367 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(
367− inlink->channel_layout, s->map[i].in_channel);
368+ m->in_channel_idx = av_get_channel_layout_channel_index(
369+ inlink->channel_layout, m->in_channel);
368370 }
369371
370− if (s->map[i].in_channel_idx < 0 ||
371− s->map[i].in_channel_idx >= nb_channels) {
372+ if (m->in_channel_idx < 0 || m->in_channel_idx >= nb_channels) {
372373 av_get_channel_layout_string(layout_name, sizeof(layout_name),
373374 0, inlink->channel_layout);
374− if (s->map[i].in_channel) {
375− channel_name = av_get_channel_name(s->map[i].in_channel);
375+ if (m->in_channel) {
376+ channel_name = av_get_channel_name(m->in_channel);
376377 av_log(ctx, AV_LOG_ERROR,
377378 "input channel '%s' not available from input layout '%s'\n",
378379 channel_name, layout_name);
379380 } else {
380381 av_log(ctx, AV_LOG_ERROR,
381382 "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);
383384 }
384385 err = AVERROR(EINVAL);
385386 }

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