diff mpc.c @ 6121:81614e9b541b libavformat

Generalize ID3v2 functions to support ID3v2-like ID headers with a different magic in the header (mainly targeted to Sony's .oma/.aa3 format). Patch by Michael Karcher, ffmpeg A mkarcher dialup fu-berlin de
author cehoyos
date Fri, 11 Jun 2010 13:44:57 +0000
parents 536e5527c1e0
children
line wrap: on
line diff
--- a/mpc.c	Fri Jun 11 13:28:42 2010 +0000
+++ b/mpc.c	Fri Jun 11 13:44:57 2010 +0000
@@ -45,7 +45,7 @@
 static int mpc_probe(AVProbeData *p)
 {
     const uint8_t *d = p->buf;
-    if (ff_id3v2_match(d)) {
+    if (ff_id3v2_match(d, ID3v2_DEFAULT_MAGIC)) {
         d += ff_id3v2_tag_len(d);
     }
     if (d+3 < p->buf+p->buf_size)
@@ -67,7 +67,7 @@
         if (url_fseek(s->pb, pos, SEEK_SET) < 0)
             return -1;
         ret = get_buffer(s->pb, buf, ID3v2_HEADER_SIZE);
-        if (ret != ID3v2_HEADER_SIZE || !ff_id3v2_match(buf)) {
+        if (ret != ID3v2_HEADER_SIZE || !ff_id3v2_match(buf, ID3v2_DEFAULT_MAGIC)) {
             av_log(s, AV_LOG_ERROR, "Not a Musepack file\n");
             return -1;
         }
@@ -82,7 +82,7 @@
         /* read ID3 tags */
         if (url_fseek(s->pb, pos, SEEK_SET) < 0)
             return -1;
-        ff_id3v2_read(s);
+        ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC);
         get_le24(s->pb);
     }
     c->ver = get_byte(s->pb);