diff options
Diffstat (limited to 'src/demuxers/id3.h')
-rw-r--r-- | src/demuxers/id3.h | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/demuxers/id3.h b/src/demuxers/id3.h index b4ea4b6be..29285bf7a 100644 --- a/src/demuxers/id3.h +++ b/src/demuxers/id3.h @@ -30,12 +30,13 @@ #include "bswap.h" /* id3v2 */ -#define FOURCC_TAG BE_FOURCC -#define ID3V22_TAG FOURCC_TAG('I', 'D', '3', 2) /* id3 v2.2 header tag */ -#define ID3V23_TAG FOURCC_TAG('I', 'D', '3', 3) /* id3 v2.3 header tag */ -#define ID3V24_TAG FOURCC_TAG('I', 'D', '3', 4) /* id3 v2.4 header tag */ -#define ID3V24_FOOTER_TAG FOURCC_TAG('3', 'D', 'I', 0) /* id3 v2.4 footer tag */ +#define ID3V22_TAG ME_FOURCC('I', 'D', '3', 2) /* id3 v2.2 header tag */ +#define ID3V23_TAG ME_FOURCC('I', 'D', '3', 3) /* id3 v2.3 header tag */ +#define ID3V24_TAG ME_FOURCC('I', 'D', '3', 4) /* id3 v2.4 header tag */ +#define ID3V24_FOOTER_TAG ME_FOURCC('3', 'D', 'I', 0) /* id3 v2.4 footer tag */ +#define ID3V2X_TAG ME_FOURCC('I', 'D', '3', 0) /* id3 v2.x header tag */ +#define ID3V2X_MASK ~ME_FOURCC( 0 , 0 , 0 , 0xFF) /* id3 v2.x header mask */ /* * ID3 v2.2 @@ -153,30 +154,27 @@ int id3v1_parse_tag (input_plugin_t *input, xine_stream_t *stream); int id3v22_parse_tag(input_plugin_t *input, xine_stream_t *stream, - int8_t *mp3_frame_header); + uint32_t id3_signature); int id3v23_parse_tag(input_plugin_t *input, xine_stream_t *stream, - int8_t *mp3_frame_header); + uint32_t id3_signature); int id3v24_parse_tag(input_plugin_t *input, xine_stream_t *stream, - int8_t *mp3_frame_header); + uint32_t id3_signature); /* Generic function that switch between the three above */ int id3v2_parse_tag(input_plugin_t *input, xine_stream_t *stream, - int8_t *mp3_frame_header); + uint32_t id3_signature); /** * @brief Checks if the given buffer is an ID3 tag preamble * @param ptr Pointer to the first 10 bytes of the ID3 tag */ -static inline int id3v2_istag(uint8_t *ptr) { - return - (ptr[0] == 'I') && - (ptr[1] == 'D') && - (ptr[2] == '3'); +static inline int id3v2_istag(uint32_t id3_signature) { + return (id3_signature & ID3V2X_MASK) == ID3V2X_TAG; } #if 0 |