diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-03-03 00:58:52 +0000 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-03-03 00:58:52 +0000 |
commit | 6a16b385d3c32e412e23f9f5d44140d7afd9af79 (patch) | |
tree | 32e1451dd03c41b60ca8e5ccf68610a87a35c1b5 /src/demuxers/demux_mpgaudio.c | |
parent | 834fb11173a04fb9febc30e8c0e6c08722114f80 (diff) | |
download | xine-lib-6a16b385d3c32e412e23f9f5d44140d7afd9af79.tar.gz xine-lib-6a16b385d3c32e412e23f9f5d44140d7afd9af79.tar.bz2 |
Add a function to parse a generic ID3v2 tag, and make both demux_aac and demux_mpgaudio use it without repeating the same code.
CVS patchset: 8636
CVS date: 2007/03/03 00:58:52
Diffstat (limited to 'src/demuxers/demux_mpgaudio.c')
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index fd79e4215..b9f35c17d 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.149 2007/03/03 00:02:30 dgp85 Exp $ + * $Id: demux_mpgaudio.c,v 1.150 2007/03/03 00:58:52 dgp85 Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -606,39 +606,14 @@ static int demux_mpgaudio_next (demux_mpgaudio_t *this, int decoder_flags, int s return parse_frame_payload(this, header_buf, decoder_flags); - } else if ((BE_32(header_buf)) == ID3V22_TAG) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": ID3V2.2 tag\n"); - if (!id3v22_parse_tag(this->input, this->stream, header_buf)) { + } else if ( header_buf[0] == 'I' && header_buf[1] == 'D' && header_buf[2] == '3' ) { + if (!id3v2_parse_tag(this->input, this->stream, header_buf)) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": ID3V2.2 tag parsing error\n"); + LOG_MODULE ": ID3V2 tag parsing error\n"); bytes = 1; /* resync */ } else { bytes = 4; } - - } else if ((BE_32(header_buf)) == ID3V23_TAG) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": ID3V2.3 tag\n"); - if (!id3v23_parse_tag(this->input, this->stream, header_buf)) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": ID3V2.3 tag parsing error\n"); - bytes = 1; /* resync */ - } else { - bytes = 4; - } - - } else if ((BE_32(header_buf)) == ID3V24_TAG) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": ID3V2.4 tag\n"); - if (!id3v24_parse_tag(this->input, this->stream, header_buf)) { - xprintf(this->stream->xine, XINE_VERBOSITY_LOG, - LOG_MODULE ": ID3V2.4 tag parsing error\n"); - bytes = 1; /* resync */ - } else { - bytes = 4; - } - } else { /* skip */ bytes = 1; |