Generalize ID3v2 functions to support ID3v2-like ID headers with a

different magic in the header (mainly targeted to Sony's .oma/.aa3
format).

Patch by Michael Karcher, ffmpeg A mkarcher dialup fu-berlin de

Originally committed as revision 23583 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Karcher
2010-06-11 13:44:57 +00:00
committed by Carl Eugen Hoyos
parent 1c1697117d
commit 3a1350e8d9
7 changed files with 29 additions and 21 deletions

View File

@@ -29,10 +29,17 @@
#define ID3v2_HEADER_SIZE 10
/**
* Detects ID3v2 Header.
* @buf must be ID3v2_HEADER_SIZE byte long
* Default magic bytes for ID3v2 header: "ID3"
*/
int ff_id3v2_match(const uint8_t *buf);
#define ID3v2_DEFAULT_MAGIC "ID3"
/**
* Detects ID3v2 Header.
* @buf must be ID3v2_HEADER_SIZE byte long
* @magic magic bytes to identify the header, machine byte order.
* If in doubt, use ID3v2_DEFAULT_MAGIC.
*/
int ff_id3v2_match(const uint8_t *buf, const char *magic);
/**
* Gets the length of an ID3v2 tag.
@@ -50,7 +57,7 @@ void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags)
/**
* Read an ID3v2 tag
*/
void ff_id3v2_read(AVFormatContext *s);
void ff_id3v2_read(AVFormatContext *s, const char *magic);
extern const AVMetadataConv ff_id3v2_metadata_conv[];