[FFmpeg-devel] [PATCH v1] avformat/utils: Fixes misdetection of zYLx.wav

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed Nov 6 21:23:05 EET 2019


Am Mi., 6. Nov. 2019 um 12:01 Uhr schrieb Limin Wang <lance.lmwang at gmail.com>:
>
> On Wed, Nov 06, 2019 at 11:30:41AM +0100, Hendrik Leppkes wrote:
> > On Wed, Nov 6, 2019 at 10:01 AM <lance.lmwang at gmail.com> wrote:
> > >
> > > From: Limin Wang <lance.lmwang at gmail.com>
> > >
> > > Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> > > ---
> > >  libavformat/utils.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > > index 8196442dd1..8381498e2b 100644
> > > --- a/libavformat/utils.c
> > > +++ b/libavformat/utils.c
> > > @@ -367,8 +367,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
> > >                 fmt->name, score);
> > >          for (i = 0; fmt_id_type[i].name; i++) {
> > >              if (!strcmp(fmt->name, fmt_id_type[i].name)) {
> > > -                if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
> > > -                    st->codecpar->sample_rate)
> > > +                if (st->codecpar->sample_rate)
> > >                      continue;
> > >                  if (st->request_probe > score &&
> > >                      st->codecpar->codec_id != fmt_id_type[i].id)
> >
> > This change seems wrong, as you are practically rejecting probing of
> > any audio now, since those would get a sample rate.
>
> By the old logic, I assume sample_rate > 0 means the audio has been detected,
> so don't probe the data again.

If sample_rate > 0 then do not consider non-audio codecs for auto-detection.

Carl Eugen


More information about the ffmpeg-devel mailing list