From f3ecab3ac824a02546809b5f19de247a549b9068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Thu, 13 Dec 2007 16:17:36 +0100 Subject: Update the FLAC demuxer to use the new id3 interface. Check the fLaC signature through ME_FOURCC comparison. --HG-- extra : transplant_source : %8D%C9%D9%96%BC%B4%B0%B1%C0%9F%1D%01%F8%8A%5DX%F8%D5k%86 --- src/demuxers/demux_flac.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c index a7a7c5009..0380de846 100644 --- a/src/demuxers/demux_flac.c +++ b/src/demuxers/demux_flac.c @@ -80,6 +80,7 @@ typedef struct { * It returns 1 if flac file was opened successfully. */ static int open_flac_file(demux_flac_t *flac) { + uint32_t signature; unsigned char preamble[10]; unsigned int block_length; unsigned char buffer[FLAC_SEEKPOINT_SIZE]; @@ -90,7 +91,7 @@ static int open_flac_file(demux_flac_t *flac) { /* fetch the file signature, 4 bytes will read both the fLaC * signature and the */ - if (_x_demux_read_header(flac->input, preamble, 4) != 4) + if (_x_demux_read_header(flac->input, &signature, 4) != 4) return 0; flac->input->seek(flac->input, 4, SEEK_SET); @@ -100,16 +101,15 @@ static int open_flac_file(demux_flac_t *flac) { * users use them and want them working, so check and skip the ID3 * tag if present. */ - if ( id3v2_istag(preamble) ) { - id3v2_parse_tag(flac->input, flac->stream, preamble); + if ( id3v2_istag(signature) ) { + id3v2_parse_tag(flac->input, flac->stream, signature); - if ( flac->input->read(flac->input, preamble, 4) != 4 ) + if ( flac->input->read(flac->input, &signature, 4) != 4 ) return 0; } /* validate signature */ - if ((preamble[0] != 'f') || (preamble[1] != 'L') || - (preamble[2] != 'a') || (preamble[3] != 'C')) + if ( signature != ME_FOURCC('f', 'L', 'a', 'C') ) return 0; /* loop through the metadata blocks; use a do-while construct since there -- cgit v1.2.3