| @@ -662,20 +662,12 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx) · 661 unmodified lines |
| 662 | int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg, | 662 | int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg, |
| 663 | void *log_ctx) | 663 | void *log_ctx) |
| 664 | { | 664 | { |
| 665 | char *tail; | | |
| 666 | int64_t chlayout; | 665 | int64_t chlayout; |
| 667 | int nb_channels; | 666 | int nb_channels; |
| 668 | | 667 | |
| 669 | if (av_get_extended_channel_layout(arg, &chlayout, &nb_channels) < 0) { | 668 | if (av_get_extended_channel_layout(arg, &chlayout, &nb_channels) < 0) { |
| 670 | /* [TEMPORARY 2016-12 -> 2017-12]*/ | 669 | av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg); |
| 671 | nb_channels = strtol(arg, &tail, 10); | 670 | return AVERROR(EINVAL); |
| 672 | if (!errno && *tail == 'c' && *(tail + 1) == '\0' && nb_channels > 0 && nb_channels < 64) { | | |
| 673 | chlayout = 0; | | |
| 674 | av_log(log_ctx, AV_LOG_WARNING, "Deprecated channel count specification '%s'. This will stop working in releases made in 2018 and after.\n", arg); | | |
| 675 | } else { | | |
| 676 | av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg); | | |
| 677 | return AVERROR(EINVAL); | | |
| 678 | } | | |
| 679 | } | 671 | } |
| 680 | if (!chlayout && !nret) { | 672 | if (!chlayout && !nret) { |
| 681 | av_log(log_ctx, AV_LOG_ERROR, "Unknown channel layout '%s' is not supported.\n", arg); | 673 | av_log(log_ctx, AV_LOG_ERROR, "Unknown channel layout '%s' is not supported.\n", arg); |