[Ffmpeg-devel] [PATCH] allow ffmpeg to read mp3s beginning with partial frames
Michael Niedermayer
michaelni
Fri Sep 8 11:24:30 CEST 2006
Hi
On Fri, Sep 08, 2006 at 09:59:30AM +0100, Victor Voros wrote:
> Michael - thank you for the feedback. I will post a revised patch today
> or tomorrow with the suggestions. I assume you're in agreement with the
> cosmetic changes. (constants bad!).
yes, ive no objections to replacing 1234 constants by named constants like
FOOBAR but that should ideally be a seperate patch
>
> I believe the false positive issue can be resolved with
>
> -if (mp3_is_frame_header(p->buf+d)) return AVPROBE_SCORE_MAX;
> +if (ff_mpa_check_header(p->buf+d/*or however its called*/)) return
> d==0?AVPROBE_SCORE_MAX:SOME_SMALL_NON_ZERO_NUMBER;
yes
>
> Wrt to the posted mp3s if there is no change to mp3_read_header but
> mp3_read_probe is changed, then ffmpeg goes seriously pear-shaped (ie
> codec thinks the random first few bytes of the file as valid sampling
> frequencies etc).
>
> It would make sense to move the partial frame skipping code (factored!)
> from mp3_read_header to the libavcodec as presumably if something is
> generating dodgy mp3 files it stands to reason something is able to mux
> said dodgy files into a dodgy .mpg.
yes thats why i am so much against doing it in lavf/mp3.c, it belongs
to the mp3 parser (libavcodec/parser.c)
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list