[FFmpeg-devel] [PATCH] common ID3v2 support for all formats

Reimar Döffinger Reimar.Doeffinger
Thu Nov 4 08:04:32 CET 2010


On Thu, Nov 04, 2010 at 07:53:19AM +0100, Anton Khirnov wrote:
> On Wed, Nov 03, 2010 at 11:12:07PM +0100, Reimar D?ffinger wrote:
> > On second thought though I have to say that I can't think of a use
> > case. Any app should retry with larger buffers until either there's
> > a match with score > AVPROBE_SCORE_MAX/4 or there is a reason to not
> > provide more data.
> There's always a reason not to provide more data -- speed. Reading very
> large probes can take quite long for remote files. The MPD author is
> reluctant to do this unless there's some hint the file is not garbage.

Can you describe the use case in more detail? Because considering
"speed" in case probe has failed is kind of like "my program is really
fast at not doing anything!".
Also for fast probing something like the "file" program might be a better
approach...
Anyway I did propose a patch, and I'm interested in feedback from you
and Michael.

> > You can't expect "if I pass at least n bytes I'll get at least some
> > indication if this is a valid format" unless n is the whole size...
> > I also don't think that the previous code was really better, I suspect
> > that MPD would have detected all formats with a large ID3v2 header as
> > MP3, even if it was actually a wav or other file.
> Yes, that's correct. But in most cases they really were mp3s. Right now
> all those files are discarded, which is clearly worse.

Only in that specific implementation. In principle I think it is more correct:
an ID3v2 header on its own is not a media file.



More information about the ffmpeg-devel mailing list