Unified · Split
| @@ -630,7 +630,7 @@ static void swap_channel_layouts_on_filter(AVFilterContext *filter) · 629 unmodified lines | ||
| 630 | 630 | |
| 631 | 631 | for (i = 0; i < filter->nb_outputs; i++) { |
| 632 | 632 | AVFilterLink *outlink = filter->outputs[i]; |
| 633 | − int best_idx, best_score = INT_MIN, best_count_diff = INT_MAX; | |
| 633 | + int best_idx = -1, best_score = INT_MIN, best_count_diff = INT_MAX; | |
| 634 | 634 | |
| 635 | 635 | if (outlink->type != AVMEDIA_TYPE_AUDIO || |
| 636 | 636 | outlink->in_channel_layouts->nb_channel_layouts < 2) |
| @@ -679,6 +679,7 @@ static void swap_channel_layouts_on_filter(AVFilterContext *filter) · 42 unmodified lines | ||
| 679 | 679 | best_count_diff = count_diff; |
| 680 | 680 | } |
| 681 | 681 | } |
| 682 | + av_assert1(best_idx>=0); | |
| 682 | 683 | FFSWAP(uint64_t, outlink->in_channel_layouts->channel_layouts[0], |
| 683 | 684 | outlink->in_channel_layouts->channel_layouts[best_idx]); |
| 684 | 685 | } |