# HG changeset patch # User bcoudurier # Date 1154392367 0 # Node ID 2a06812eeca7881221d2c25bf418d25eaa563452 # Parent 29b89b8d6d4d0197fcdf71c20e7879abcba6e2e1 skip run-in sequence during probe diff -r 29b89b8d6d4d -r 2a06812eeca7 mxf.c --- a/mxf.c Mon Jul 31 15:26:33 2006 +0000 +++ b/mxf.c Tue Aug 01 00:32:47 2006 +0000 @@ -919,14 +919,19 @@ } 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; }