aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-02-26 08:45:59 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-02-26 08:45:59 +0000
commite34a5996b9c73d6cac7413f4e5411f69356c89db (patch)
tree449843aad0094d34a3629471e861011c6d35bd08 /libavformat
parent2578326f13e5ea7945e2da810238118832dfb7a1 (diff)
downloadffmpeg-e34a5996b9c73d6cac7413f4e5411f69356c89db.tar.gz
dv probe
Originally committed as revision 17607 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dv.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 7b4cb0b093..820c3b5cec 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -474,12 +474,30 @@ static int dv_read_close(AVFormatContext *s)
return 0;
}
+static int dv_probe(AVProbeData *p)
+{
+ unsigned state;
+ int i;
+
+ if (p->buf_size < 5)
+ return 0;
+
+ state = AV_RB32(p->buf);
+ for (i = 4; i < p->buf_size; i++) {
+ if ((state & 0xffffff7f) == 0x1f07003f)
+ return AVPROBE_SCORE_MAX*3/4; // not max to avoid dv in mov to match
+ state = (state << 8) | p->buf[i];
+ }
+
+ return 0;
+}
+
#if CONFIG_DV_DEMUXER
AVInputFormat dv_demuxer = {
"dv",
NULL_IF_CONFIG_SMALL("DV video format"),
sizeof(RawDVContext),
- NULL,
+ dv_probe,
dv_read_header,
dv_read_packet,
dv_read_close,