[FFmpeg-cvslog] r20194 - trunk/libavformat/tmv.c

daniel subversion
Fri Oct 9 20:24:47 CEST 2009


Author: daniel
Date: Fri Oct  9 20:24:47 2009
New Revision: 20194

Log:
Stricter TMV probe

Modified:
   trunk/libavformat/tmv.c

Modified: trunk/libavformat/tmv.c
==============================================================================
--- trunk/libavformat/tmv.c	Fri Oct  9 17:38:44 2009	(r20193)
+++ trunk/libavformat/tmv.c	Fri Oct  9 20:24:47 2009	(r20194)
@@ -43,10 +43,19 @@ typedef struct TMVContext {
     unsigned stream_index;
 } TMVContext;
 
+#define PROBE_MIN_SAMPLE_RATE 5000
+#define PROBE_MAX_FPS         120
+#define PROBE_MIN_AUDIO_SIZE  (PROBE_MIN_SAMPLE_RATE / PROBE_MAX_FPS)
+
 static int tmv_probe(AVProbeData *p)
 {
-    if (AV_RL32(p->buf) == TMV_TAG)
-        return AVPROBE_SCORE_MAX;
+    if (AV_RL32(p->buf)   == TMV_TAG &&
+        AV_RL16(p->buf+4) >= PROBE_MIN_SAMPLE_RATE &&
+        AV_RL16(p->buf+6) >= PROBE_MIN_AUDIO_SIZE  &&
+               !p->buf[8] && // compression method
+                p->buf[9] && // char cols
+                p->buf[10])  // char rows
+        return AVPROBE_SCORE_MAX / (p->buf[9] == 40 && p->buf[10] == 25)? 1 : 4;
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list