diff mbox series

[FFmpeg-devel] fix for https://trac.ffmpeg.org/ticket/9057

Message ID 20210121165114.15808-1-konstantin@boffins.se
State Accepted
Commit fbe9b0c8f3ee1ff1d36c6a6cd7fe6fc0c6a9e80d
Headers show
Series [FFmpeg-devel] fix for https://trac.ffmpeg.org/ticket/9057 | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Konstantin Mamalakis Jan. 21, 2021, 4:51 p.m. UTC
From: KM <the.real.laplace@gmail.com>

---
 libavcodec/aacdec_template.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Robert Nagy Feb. 3, 2021, 9:49 p.m. UTC | #1
Any feedback on this? Would also like this fixed.
Carl Eugen Hoyos Feb. 3, 2021, 10:05 p.m. UTC | #2
Am Do., 21. Jan. 2021 um 17:59 Uhr schrieb <konstantin@boffins.se>:
>
> From: KM <the.real.laplace@gmail.com>
>
> ---
>  libavcodec/aacdec_template.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
> index fbe3074..3c2dbe3 100644
> --- a/libavcodec/aacdec_template.c
> +++ b/libavcodec/aacdec_template.c
> @@ -639,11 +639,14 @@ static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx,
>       * As actual intended 7.1(wide) streams are very rare, default to assuming a
>       * 7.1 layout was intended.
>       */
> -    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT && (!ac || !ac->warned_71_wide++)) {
> -        av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
> -               " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
> -               " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
> +    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
>          layout_map[2][2] = AAC_CHANNEL_SIDE;
> +
> +        if (!ac || !ac->warned_71_wide++) {
> +            av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
> +                   " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
> +                   " according to the specification instead.\n", FF_COMPLIANCE_STRICT);

I will push this if there are no objections.

Carl Eugen
Anton Khirnov Feb. 4, 2021, 10:37 a.m. UTC | #3
Quoting Carl Eugen Hoyos (2021-02-03 23:05:08)
> Am Do., 21. Jan. 2021 um 17:59 Uhr schrieb <konstantin@boffins.se>:
> >
> > From: KM <the.real.laplace@gmail.com>
> >
> > ---
> >  libavcodec/aacdec_template.c | 11 +++++++----
> >  1 file changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
> > index fbe3074..3c2dbe3 100644
> > --- a/libavcodec/aacdec_template.c
> > +++ b/libavcodec/aacdec_template.c
> > @@ -639,11 +639,14 @@ static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx,
> >       * As actual intended 7.1(wide) streams are very rare, default to assuming a
> >       * 7.1 layout was intended.
> >       */
> > -    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT && (!ac || !ac->warned_71_wide++)) {
> > -        av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
> > -               " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
> > -               " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
> > +    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
> >          layout_map[2][2] = AAC_CHANNEL_SIDE;
> > +
> > +        if (!ac || !ac->warned_71_wide++) {
> > +            av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
> > +                   " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
> > +                   " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
> 
> I will push this if there are no objections.

At the very least it needs a better commit message that explains what is
done rather than "fix bug"
Carl Eugen Hoyos Feb. 16, 2021, 10:40 p.m. UTC | #4
Am Do., 21. Jan. 2021 um 17:59 Uhr schrieb <konstantin@boffins.se>:
>
> From: KM <the.real.laplace@gmail.com>
>
> ---
>  libavcodec/aacdec_template.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
> index fbe3074..3c2dbe3 100644
> --- a/libavcodec/aacdec_template.c
> +++ b/libavcodec/aacdec_template.c
> @@ -639,11 +639,14 @@ static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx,
>       * As actual intended 7.1(wide) streams are very rare, default to assuming a
>       * 7.1 layout was intended.
>       */
> -    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT && (!ac || !ac->warned_71_wide++)) {
> -        av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
> -               " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
> -               " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
> +    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
>          layout_map[2][2] = AAC_CHANNEL_SIDE;
> +
> +        if (!ac || !ac->warned_71_wide++) {
> +            av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
> +                   " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
> +                   " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
> +        }

Patch applied.

Thank you, Carl Eugen
diff mbox series

Patch

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index fbe3074..3c2dbe3 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -639,11 +639,14 @@  static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx,
      * As actual intended 7.1(wide) streams are very rare, default to assuming a
      * 7.1 layout was intended.
      */
-    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT && (!ac || !ac->warned_71_wide++)) {
-        av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
-               " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
-               " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
+    if (channel_config == 7 && avctx->strict_std_compliance < FF_COMPLIANCE_STRICT) {
         layout_map[2][2] = AAC_CHANNEL_SIDE;
+
+        if (!ac || !ac->warned_71_wide++) {
+            av_log(avctx, AV_LOG_INFO, "Assuming an incorrectly encoded 7.1 channel layout"
+                   " instead of a spec-compliant 7.1(wide) layout, use -strict %d to decode"
+                   " according to the specification instead.\n", FF_COMPLIANCE_STRICT);
+        }
     }
 
     return 0;