Browse Source

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>
tags/n2.2-rc1
Reynaldo H. Verdejo Pinochet 11 years ago
parent
commit
95d1809981
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/mtv.c

+ 4
- 0
libavformat/mtv.c View File

@@ -63,6 +63,10 @@ static int mtv_probe(AVProbeData *p)
if (*p->buf != 'A' || *(p->buf + 1) != 'M' || *(p->buf + 2) != 'V')
return 0;

/* Audio magic is always MP3 */
if (p->buf[43] != 'M' || p->buf[44] != 'P' || p->buf[45] != '3')
return 0;

/* Check for nonzero in bpp and (width|height) header fields */
if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
return 0;


Loading…
Cancel
Save