diff options
author | Marton Balint <cus@passwd.hu> | 2019-04-02 18:24:21 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2019-04-11 21:17:57 +0200 |
commit | 6ed7df5b20e46b30f16deca5b619a1cf88bd48b3 (patch) | |
tree | 444c65d54eea44fd16e43ef8365ec18f8446c563 /libavformat | |
parent | c5a825dc7536e948f540c203f494e2a14a5e509b (diff) | |
download | ffmpeg-6ed7df5b20e46b30f16deca5b619a1cf88bd48b3.tar.gz |
avformat/mxfdec: export operational pattern UL as file metadata
Can be useful for API users as ffmpeg/libavformat can't properly support some
operational patterns.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mxfdec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 1ba8ecd4a6..8c65a2bbcf 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -654,6 +654,7 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFContext *mxf = arg; + AVFormatContext *s = mxf->fc; MXFPartition *partition, *tmp_part; UID op; uint64_t footer_partition; @@ -718,6 +719,12 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size } nb_essence_containers = avio_rb32(pb); + if (partition->type == Header) { + char str[36]; + snprintf(str, sizeof(str), "%08x.%08x.%08x.%08x", AV_RB32(&op[0]), AV_RB32(&op[4]), AV_RB32(&op[8]), AV_RB32(&op[12])); + av_dict_set(&s->metadata, "operational_pattern", str, 0); + } + if (partition->this_partition && partition->previous_partition == partition->this_partition) { av_log(mxf->fc, AV_LOG_ERROR, |