Commit 9d01ce26 authored by daniel's avatar daniel

Stricter TMV probe



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20194 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f1de9700
...@@ -43,10 +43,19 @@ typedef struct TMVContext { ...@@ -43,10 +43,19 @@ typedef struct TMVContext {
unsigned stream_index; unsigned stream_index;
} TMVContext; } 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) static int tmv_probe(AVProbeData *p)
{ {
if (AV_RL32(p->buf) == TMV_TAG) if (AV_RL32(p->buf) == TMV_TAG &&
return AVPROBE_SCORE_MAX; 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment