summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-08-01 00:32:47 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-08-01 00:32:47 +0000
commitba32c8dfd9efd5a9e595e4575425d39a333057fb (patch)
tree6a081733b9747f2fee36b28af4bf46bf093aa4d5 /libavformat
parenteb9ab5834ce75f0695814ab5cd8ecf657ed412b6 (diff)
skip run-in sequence during probe
Originally committed as revision 5876 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxf.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libavformat/mxf.c b/libavformat/mxf.c
index aaf9a1833f..2eb026c5a9 100644
--- a/libavformat/mxf.c
+++ b/libavformat/mxf.c
@@ -919,14 +919,19 @@ static int mxf_read_close(AVFormatContext *s)
}
static int mxf_probe(AVProbeData *p) {
- /* KLV packet describing MXF header partition pack */
+ uint8_t *bufp = p->buf;
+ uint8_t *end = p->buf + p->buf_size;
+
if (p->buf_size < sizeof(mxf_header_partition_pack_key))
return 0;
- if (IS_KLV_KEY(p->buf, mxf_header_partition_pack_key))
- return AVPROBE_SCORE_MAX;
- else
- return 0;
+ /* Must skip Run-In Sequence and search for MXF header partition pack key SMPTE 377M 5.5 */
+ end -= sizeof(mxf_header_partition_pack_key);
+ for (; bufp < end; bufp++) {
+ if (IS_KLV_KEY(bufp, mxf_header_partition_pack_key))
+ return AVPROBE_SCORE_MAX;
+ }
+ return 0;
}