diff mbox

[FFmpeg-devel] avfilter/formats: remove support for deprecated channel count specification

Message ID 20180106210635.17369-1-cus@passwd.hu
State Accepted
Commit e3acba0d5d7b5b35b779b25ec3a76a4d80a405ea
Headers show

Commit Message

Marton Balint Jan. 6, 2018, 9:06 p.m. UTC
Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavfilter/formats.c         | 12 ++----------
 tests/ref/fate/filter-formats |  2 +-
 2 files changed, 3 insertions(+), 11 deletions(-)

Comments

Marton Balint Jan. 13, 2018, 9:10 p.m. UTC | #1
On Sat, 6 Jan 2018, Marton Balint wrote:

> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavfilter/formats.c         | 12 ++----------
> tests/ref/fate/filter-formats |  2 +-
> 2 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/libavfilter/formats.c b/libavfilter/formats.c
> index 20a2c89719..31ee445c49 100644
> --- a/libavfilter/formats.c
> +++ b/libavfilter/formats.c
> @@ -662,20 +662,12 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx)
> int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg,
>                             void *log_ctx)
> {
> -    char *tail;
>     int64_t chlayout;
>     int nb_channels;
>
>     if (av_get_extended_channel_layout(arg, &chlayout, &nb_channels) < 0) {
> -        /* [TEMPORARY 2016-12 -> 2017-12]*/
> -        nb_channels = strtol(arg, &tail, 10);
> -        if (!errno && *tail == 'c' && *(tail + 1) == '\0' && nb_channels > 0 && nb_channels < 64) {
> -            chlayout = 0;
> -            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);
> -        } else {
> -            av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
> -            return AVERROR(EINVAL);
> -        }
> +        av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
> +        return AVERROR(EINVAL);
>     }
>     if (!chlayout && !nret) {
>         av_log(log_ctx, AV_LOG_ERROR, "Unknown channel layout '%s' is not supported.\n", arg);
> diff --git a/tests/ref/fate/filter-formats b/tests/ref/fate/filter-formats
> index ea85eed23d..17ff5b222f 100644
> --- a/tests/ref/fate/filter-formats
> +++ b/tests/ref/fate/filter-formats
> @@ -75,7 +75,7 @@ quad(side)
> 0 = ff_parse_channel_layout(0000000000000004,  1, 1c);
> 0 = ff_parse_channel_layout(0000000000000003,  2, 2c);
> -1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, -1c);
> -0 = ff_parse_channel_layout(0000000000000000, 60, 60c);
> +-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 60c);
> -1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 65c);
> 0 = ff_parse_channel_layout(0000000000000000,  2, 2C);
> 0 = ff_parse_channel_layout(0000000000000000, 60, 60C);

Will apply soon.

Regards,
Marton
Marton Balint Jan. 20, 2018, 5:16 p.m. UTC | #2
On Sat, 6 Jan 2018, Marton Balint wrote:

> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
> libavfilter/formats.c         | 12 ++----------
> tests/ref/fate/filter-formats |  2 +-
> 2 files changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/libavfilter/formats.c b/libavfilter/formats.c
> index 20a2c89719..31ee445c49 100644
> --- a/libavfilter/formats.c
> +++ b/libavfilter/formats.c
> @@ -662,20 +662,12 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx)
> int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg,
>                             void *log_ctx)
> {
> -    char *tail;
>     int64_t chlayout;
>     int nb_channels;
>
>     if (av_get_extended_channel_layout(arg, &chlayout, &nb_channels) < 0) {
> -        /* [TEMPORARY 2016-12 -> 2017-12]*/
> -        nb_channels = strtol(arg, &tail, 10);
> -        if (!errno && *tail == 'c' && *(tail + 1) == '\0' && nb_channels > 0 && nb_channels < 64) {
> -            chlayout = 0;
> -            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);
> -        } else {
> -            av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
> -            return AVERROR(EINVAL);
> -        }
> +        av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
> +        return AVERROR(EINVAL);
>     }
>     if (!chlayout && !nret) {
>         av_log(log_ctx, AV_LOG_ERROR, "Unknown channel layout '%s' is not supported.\n", arg);
> diff --git a/tests/ref/fate/filter-formats b/tests/ref/fate/filter-formats
> index ea85eed23d..17ff5b222f 100644
> --- a/tests/ref/fate/filter-formats
> +++ b/tests/ref/fate/filter-formats
> @@ -75,7 +75,7 @@ quad(side)
> 0 = ff_parse_channel_layout(0000000000000004,  1, 1c);
> 0 = ff_parse_channel_layout(0000000000000003,  2, 2c);
> -1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, -1c);
> -0 = ff_parse_channel_layout(0000000000000000, 60, 60c);
> +-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 60c);
> -1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 65c);
> 0 = ff_parse_channel_layout(0000000000000000,  2, 2C);
> 0 = ff_parse_channel_layout(0000000000000000, 60, 60C);

Pushed.

Regards,
Marton
diff mbox

Patch

diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index 20a2c89719..31ee445c49 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -662,20 +662,12 @@  int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx)
 int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg,
                             void *log_ctx)
 {
-    char *tail;
     int64_t chlayout;
     int nb_channels;
 
     if (av_get_extended_channel_layout(arg, &chlayout, &nb_channels) < 0) {
-        /* [TEMPORARY 2016-12 -> 2017-12]*/
-        nb_channels = strtol(arg, &tail, 10);
-        if (!errno && *tail == 'c' && *(tail + 1) == '\0' && nb_channels > 0 && nb_channels < 64) {
-            chlayout = 0;
-            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);
-        } else {
-            av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
-            return AVERROR(EINVAL);
-        }
+        av_log(log_ctx, AV_LOG_ERROR, "Invalid channel layout '%s'\n", arg);
+        return AVERROR(EINVAL);
     }
     if (!chlayout && !nret) {
         av_log(log_ctx, AV_LOG_ERROR, "Unknown channel layout '%s' is not supported.\n", arg);
diff --git a/tests/ref/fate/filter-formats b/tests/ref/fate/filter-formats
index ea85eed23d..17ff5b222f 100644
--- a/tests/ref/fate/filter-formats
+++ b/tests/ref/fate/filter-formats
@@ -75,7 +75,7 @@  quad(side)
 0 = ff_parse_channel_layout(0000000000000004,  1, 1c);
 0 = ff_parse_channel_layout(0000000000000003,  2, 2c);
 -1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, -1c);
-0 = ff_parse_channel_layout(0000000000000000, 60, 60c);
+-1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 60c);
 -1 = ff_parse_channel_layout(FFFFFFFFFFFFFFFF, -1, 65c);
 0 = ff_parse_channel_layout(0000000000000000,  2, 2C);
 0 = ff_parse_channel_layout(0000000000000000, 60, 60C);