Le nonidi 29 messidor, an CCXXII, Carl Eugen Hoyos a écrit : > > if (... && min - tolerance < 2 * tolerance) ^^^^^^^^^^^ ^^^ This bit was a leftover from a slightly different version I tried at first, it was wrong.
> > I also find this version easier to understand. > > Thank you, new patch attached. > > > I can not judge on the correctness, though. > > The logic is copied from asfdec.c. > > Please review, Carl Eugen > diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c > index 8335388..cf5aa73 100644 > --- a/libavformat/mp3dec.c > +++ b/libavformat/mp3dec.c > @@ -138,6 +138,7 @@ static void mp3_parse_info_tag(AVFormatContext *s, > AVStream *st, > > MP3DecContext *mp3 = s->priv_data; > static const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}}; > + uint64_t min, delta, fsize = avio_size(s->pb); > > /* Check for Xing / Info tag */ > avio_skip(s->pb, xing_offtbl[c->lsf == 1][c->nb_channels == 1]); > @@ -151,6 +152,10 @@ static void mp3_parse_info_tag(AVFormatContext *s, > AVStream *st, > mp3->frames = avio_rb32(s->pb); > if (v & XING_FLAG_SIZE) > mp3->header_filesize = avio_rb32(s->pb); > + min = FFMIN(fsize, mp3->header_filesize); > + delta = FFMAX(fsize, mp3->header_filesize) - min; > + if (fsize && mp3->header_filesize > 0 && delta > min >> 4) > + mp3->frames = 0; > if (v & XING_FLAG_TOC) > read_xing_toc(s, mp3->header_filesize, av_rescale_q(mp3->frames, > (AVRational){spf, c->sample_rate}, No more remarks from me, but I do not maintain that part of the code. Thanks. Regards, -- Nicolas George
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel