shithub: mp3dec

Download patch

ref: 6fc51c39f0f9b30421e9dc8994cd69f9a647f37b
parent: fb1b696969b6a8e6f9ef70ab4f5d28f0f2113ae3
author: lieff <lieff@users.noreply.github.com>
date: Sat Jul 13 09:03:19 EDT 2019

add optional ID3v1 skip

--- a/minimp3_ex.h
+++ b/minimp3_ex.h
@@ -88,6 +88,10 @@
         return;
     buf      += id3v2size;
     buf_size -= id3v2size;
+#ifdef MINIMP3_SKIP_ID3V1
+    if (buf_size > 128 && !strncmp((char *)buf + buf_size - 128, "TAG", 3))
+        buf_size -= 128;
+#endif
     /* try to make allocation size assumption by first frame */
     mp3dec_init(dec);
     int samples;
--- a/minimp3_test.c
+++ b/minimp3_test.c
@@ -3,6 +3,7 @@
 /*#define MINIMP3_NONSTANDARD_BUT_LOGICAL*/
 #define MINIMP3_IMPLEMENTATION
 #define MINIMP3_ALLOW_MONO_STEREO_TRANSITION
+#define MINIMP3_SKIP_ID3V1
 #include "minimp3_ex.h"
 #include <stdio.h>
 #include <math.h>
binary files /dev/null b/vectors/l3-id3v1.bit differ
binary files /dev/null b/vectors/l3-id3v1.pcm differ