aboutsummaryrefslogtreecommitdiffstats
path: root/src/mp3_decode.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-03-05 01:29:08 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-03-05 01:29:08 +0000
commit4e4faf61748d7f10b5d96aa0f9125bf248675de0 (patch)
tree7e4ee9054691892706851cb6cbfe3b28b5e71391 /src/mp3_decode.c
parent124854ff511ebca49a219eb82b882595e1a12384 (diff)
downloadmpd-4e4faf61748d7f10b5d96aa0f9125bf248675de0.tar.gz
mpd-4e4faf61748d7f10b5d96aa0f9125bf248675de0.tar.xz
mpd-4e4faf61748d7f10b5d96aa0f9125bf248675de0.zip
see if we can skip past tags
git-svn-id: https://svn.musicpd.org/mpd/trunk@199 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/mp3_decode.c')
-rw-r--r--src/mp3_decode.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/mp3_decode.c b/src/mp3_decode.c
index 780c3814c..42afdac6a 100644
--- a/src/mp3_decode.c
+++ b/src/mp3_decode.c
@@ -25,6 +25,13 @@
#else
#include <mad.h>
#endif
+#ifdef HAVE_ID3TAG
+#ifdef USE_MPD_ID3TAG
+#include "libid3tag/id3tag.h"
+#else
+#include <id3tag.h>
+#endif
+#endif
#include "playerData.h"
#include "log.h"
@@ -181,7 +188,19 @@ int decodeNextFrameHeader(mp3DecodeData * data) {
}
}
if(mad_header_decode(&data->frame.header,&data->stream)) {
- if((data->stream).error==MAD_ERROR_LOSTSYNC) return DECODE_SKIP;
+ if((data->stream).error==MAD_ERROR_LOSTSYNC) {
+#ifdef HAVE_ID3TAG
+ signed long tagsize = id3_tag_query(
+ (data->stream).this_frame,
+ (data->stream).bufend-
+ (data->stream).this_frame);
+ if(tagsize>0) {
+ mad_stream_skip(&(data->stream),tagsize);
+ return DECODE_CONT;
+ }
+#endif
+ return DECODE_SKIP;
+ }
if(MAD_RECOVERABLE((data->stream).error)) return DECODE_CONT;
else {
if((data->stream).error==MAD_ERROR_BUFLEN) return DECODE_CONT;
@@ -206,7 +225,19 @@ int decodeNextFrame(mp3DecodeData * data) {
}
}
if(mad_frame_decode(&data->frame,&data->stream)) {
- if((data->stream).error==MAD_ERROR_LOSTSYNC) return DECODE_SKIP;
+ if((data->stream).error==MAD_ERROR_LOSTSYNC) {
+#ifdef HAVE_ID3TAG
+ signed long tagsize = id3_tag_query(
+ (data->stream).this_frame,
+ (data->stream).bufend-
+ (data->stream).this_frame);
+ if(tagsize>0) {
+ mad_stream_skip(&(data->stream),tagsize);
+ return DECODE_CONT;
+ }
+#endif
+ return DECODE_SKIP;
+ }
if(MAD_RECOVERABLE((data->stream).error)) return DECODE_CONT;
else {
if((data->stream).error==MAD_ERROR_BUFLEN) return DECODE_CONT;