Browse code

libavformat/mtv: add test for audio magic

MTV files have the string "MP3" as audio magic on their
header. Always.

Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>

Reynaldo H. Verdejo Pinochet authored on 2014/01/25 06:40:04
Showing 1 changed files
... ...
@@ -63,6 +63,10 @@ static int mtv_probe(AVProbeData *p)
63 63
     if (*p->buf != 'A' || *(p->buf + 1) != 'M' || *(p->buf + 2) != 'V')
64 64
         return 0;
65 65
 
66
+    /* Audio magic is always MP3 */
67
+    if (p->buf[43] != 'M' || p->buf[44] != 'P' || p->buf[45] != '3')
68
+        return 0;
69
+
66 70
     /* Check for nonzero in bpp and (width|height) header fields */
67 71
     if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
68 72
         return 0;