diff mbox

[FFmpeg-devel,PATCH/RFC] lavf/aacdec: Do not auto-detect a single frame

Message ID CAB0OVGrUmvr=SQhCp6O-93CzRrhM6B1hEHzxAopG+eGhy+e30A@mail.gmail.com
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Sept. 24, 2016, 1:11 p.m. UTC
Hi!

2016-09-24 14:58 GMT+02:00 Ronald S. Bultje <rsbultje@gmail.com>:
>
> On Fri, Sep 23, 2016 at 6:00 PM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:
>>
>> I use this patch locally for some time. It fixes
>> many misdetections, a similar patch was applied to
>> loas detection three years ago.
>> An alternative would be to return "1" for two frames.
>
>
> Is there any point in detecting two AAC frames? I mean, we're
> talking about a split second audio...

True, but I believe if it is the beginning of the file, a positive
score should be returned, so new patch attached.

Thank you, Carl Eugen

Comments

wm4 Sept. 24, 2016, 1:24 p.m. UTC | #1
On Sat, 24 Sep 2016 15:11:33 +0200
Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:

> Hi!
> 
> 2016-09-24 14:58 GMT+02:00 Ronald S. Bultje <rsbultje@gmail.com>:
> >
> > On Fri, Sep 23, 2016 at 6:00 PM, Carl Eugen Hoyos <cehoyos@ag.or.at> wrote:  
> >>
> >> I use this patch locally for some time. It fixes
> >> many misdetections, a similar patch was applied to
> >> loas detection three years ago.
> >> An alternative would be to return "1" for two frames.  
> >
> >
> > Is there any point in detecting two AAC frames? I mean, we're
> > talking about a split second audio...  
> 
> True, but I believe if it is the beginning of the file, a positive
> score should be returned, so new patch attached.
> 
> Thank you, Carl Eugen

Can only be an improvement.

Also thanks for switching to git format-patches.
Ronald S. Bultje Sept. 24, 2016, 2:04 p.m. UTC | #2
Hi,

On Sat, Sep 24, 2016 at 9:11 AM, Carl Eugen Hoyos <ceffmpeg@gmail.com>
wrote:

> Hi!
>
> 2016-09-24 14:58 GMT+02:00 Ronald S. Bultje <rsbultje@gmail.com>:
> >
> > On Fri, Sep 23, 2016 at 6:00 PM, Carl Eugen Hoyos <cehoyos@ag.or.at>
> wrote:
> >>
> >> I use this patch locally for some time. It fixes
> >> many misdetections, a similar patch was applied to
> >> loas detection three years ago.
> >> An alternative would be to return "1" for two frames.
> >
> >
> > Is there any point in detecting two AAC frames? I mean, we're
> > talking about a split second audio...
>
> True, but I believe if it is the beginning of the file, a positive
> score should be returned, so new patch attached.


If you prefer that, that's fine also.

Ronald
Carl Eugen Hoyos Sept. 24, 2016, 4:34 p.m. UTC | #3
2016-09-24 16:04 GMT+02:00 Ronald S. Bultje <rsbultje@gmail.com>:

>> >> An alternative would be to return "1" for two frames.
>> >
>> > Is there any point in detecting two AAC frames? I mean, we're
>> > talking about a split second audio...
>>
>> True, but I believe if it is the beginning of the file, a positive
>> score should be returned, so new patch attached.
>
> If you prefer that, that's fine also.

Patch applied.

Thank you, Carl Eugen
diff mbox

Patch

From ab91c039600b4518dc34a61d42176b1d68b814a1 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date: Sat, 24 Sep 2016 15:09:27 +0200
Subject: [PATCH] lavf/aacdec: Do not autodetect a single frame inside the
 file.

---
 libavformat/aacdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
index aa23756..fecb1e3 100644
--- a/libavformat/aacdec.c
+++ b/libavformat/aacdec.c
@@ -70,7 +70,7 @@  static int adts_aac_probe(AVProbeData *p)
         return AVPROBE_SCORE_EXTENSION;
     else if (max_frames >= 3)
         return AVPROBE_SCORE_EXTENSION / 2;
-    else if (max_frames >= 1)
+    else if (first_frames >= 1)
         return 1;
     else
         return 0;
-- 
1.7.10.4