[FFmpeg-cvslog] libavformat/mtv: add test for audio magic

Reynaldo H. Verdejo Pinochet git at videolan.org
Sun Feb 2 06:19:50 CET 2014


ffmpeg | branch: master | Reynaldo H. Verdejo Pinochet <r.verdejo at sisa.samsung.com> | Fri Jan 24 18:40:04 2014 -0300| [95d180998193da60fbcacf59f920c98a0bf43c66] | committer: Reynaldo H. Verdejo Pinochet

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 at sisa.samsung.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=95d180998193da60fbcacf59f920c98a0bf43c66
---

 libavformat/mtv.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 071af4c..b449d58 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -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;



More information about the ffmpeg-cvslog mailing list