diff mpc.c @ 4254:d05b13327b07 libavformat

Fix probing of files with ID3v2 tags. Discussed at http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2009-January/059302.html
author alexc
date Mon, 19 Jan 2009 21:54:06 +0000
parents 1d3d17de20ba
children 304a0ea063f0
line wrap: on
line diff
--- a/mpc.c	Mon Jan 19 17:01:22 2009 +0000
+++ b/mpc.c	Mon Jan 19 21:54:06 2009 +0000
@@ -21,6 +21,7 @@
 
 #include "libavcodec/bitstream.h"
 #include "avformat.h"
+#include "id3v2.h"
 
 #define MPC_FRAMESIZE  1152
 #define DELAY_FRAMES   32
@@ -43,10 +44,12 @@
 static int mpc_probe(AVProbeData *p)
 {
     const uint8_t *d = p->buf;
+    if (ff_id3v2_match(d)) {
+        d += ff_id3v2_tag_len(d);
+    }
+    if (d+3 < p->buf+p->buf_size)
     if (d[0] == 'M' && d[1] == 'P' && d[2] == '+' && (d[3] == 0x17 || d[3] == 0x7))
         return AVPROBE_SCORE_MAX;
-    if (d[0] == 'I' && d[1] == 'D' && d[2] == '3')
-        return AVPROBE_SCORE_MAX / 2;
     return 0;
 }