[FFmpeg-devel] [PATCH] libavformat/mxfdec: export user comments metadata

Michael Niedermayer michaelni at gmx.at
Fri Mar 6 23:24:28 CET 2015


On Fri, Mar 06, 2015 at 01:24:35PM -0800, Mark Reid wrote:
> ---
>  libavformat/mxf.h    |  1 +
>  libavformat/mxfdec.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++---
>  2 files changed, 93 insertions(+), 4 deletions(-)
[...]
> @@ -1630,6 +1692,30 @@ static MXFStructuralComponent* mxf_resolve_sourceclip(MXFContext *mxf, UID *stro
>      return NULL;
>  }
>  
> +static int mxf_parse_package_comments(MXFContext *mxf, AVDictionary **pm, MXFPackage *package)
> +{
> +    MXFTaggedValue *tag;
> +    int size, i;
> +    const char *prefix = "comment_";
> +    char *key = NULL;
> +
> +    for (i = 0; i < package->comment_count; i++) {
> +        tag = mxf_resolve_strong_ref(mxf, &package->comment_refs[i], TaggedValue);
> +        if (!tag || !tag->name || !tag->value)
> +            continue;
> +
> +        size = strlen(prefix) + strlen(tag->name) + 1;
> +        key = av_mallocz(size);
> +        if (!key)
> +            return AVERROR(ENOMEM);
> +
> +        strcpy(key, prefix);

> +        strlcat(key, tag->name, size);

not available on all platforms, please use av_strlcat()

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150306/cd5594d4/attachment.asc>


More information about the ffmpeg-devel mailing list