summaryrefslogtreecommitdiff
path: root/libavformat/dv.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-09 17:31:35 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-09 18:39:09 +0100
commitef8f293472851e77800bc6bd8004d7b27ec4a2bf (patch)
treee1f752d9cf0ea580c5c33716e85359d7142704b2 /libavformat/dv.c
parente624df5dc33fb1ded7b8b23a72565f882dbb0387 (diff)
avformat/dv: consider a header match at byte 0 to count as detection of dv in probe
This reduces the amount of data needed to identify dv Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/dv.c')
-rw-r--r--libavformat/dv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index bc649e637e..359040662d 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -585,6 +585,7 @@ static int dv_probe(AVProbeData *p)
unsigned state, marker_pos = 0;
int i;
int matches = 0;
+ int firstmatch = 0;
int secondary_matches = 0;
if (p->buf_size < 5)
@@ -597,8 +598,11 @@ static int dv_probe(AVProbeData *p)
// should appear around every 12000 bytes, at least 10 per frame
if ((state & 0xff07ff7f) == 0x1f07003f) {
secondary_matches++;
- if ((state & 0xffffff7f) == 0x1f07003f)
+ if ((state & 0xffffff7f) == 0x1f07003f) {
matches++;
+ if (!i)
+ firstmatch = 1;
+ }
}
if (state == 0x003f0700 || state == 0xff3f0700)
marker_pos = i;
@@ -608,7 +612,7 @@ static int dv_probe(AVProbeData *p)
}
if (matches && p->buf_size / matches < 1024 * 1024) {
- if (matches > 4 ||
+ if (matches > 4 || firstmatch ||
(secondary_matches >= 10 &&
p->buf_size / secondary_matches < 24000))
// not max to avoid dv in mov to match