[FFmpeg-devel] [PATCH] Handle metadata in oma demuxer

Michael Karcher ffmpeg
Wed Jun 2 18:06:48 CEST 2010

Am Mittwoch, den 02.06.2010, 17:55 +0200 schrieb Aurelien Jacobs:
> Huh... Just pass this as a string, this is simpler and more readable:
> static const char *id3v2_ea3_magic "ea";
> [...]
> ff_id3v2_match(buf, id3v2_ea3_magic);
> [...]
> int ff_id3v2_match(const uint8_t *buf, char *magic)
> {
>     return  buf[0]         == magic[0] &&
>             buf[1]         == magic[1] &&
>             buf[2]         ==  '3' &&
> [...]

This adds another layer of indirection, as instead of "ea", the
*address* of "ea" is passed. I was essentially trying to avoid that.
Also the memory access to magic[0] and magic[1] very likely will be a
cache miss.

As it is "cold" code, performance probably isn't that critical, but as
ffmpeg people seem to be very strict on performance, I tried to get the
maximum out of it.

  Michael Karcher

More information about the ffmpeg-devel mailing list