[FFmpeg-devel] [PATCH] avformat/mxfenc: Only store user comment related tags when needed

tim nicholson nichot20 at yahoo.com
Tue Nov 10 14:01:44 CET 2015


On 10/11/15 12:28, Michael Niedermayer wrote:
> From: Michael Niedermayer <michael at niedermayer.cc>
> 
> Also support disabling them as they seem to cause problems to some
> Users. They are also not allowed in IRT D-10 thus the default for
> mxf_d10 is not to write them
> 
> This also decreases the filesize when no user comment are stored
> 
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  doc/muxers.texi                      |   15 ++++++++++
>  libavformat/mxfenc.c                 |   46 +++++++++++++++++++++--------
>  tests/ref/lavf/mxf                   |   12 ++++----
>  tests/ref/lavf/mxf_d10               |    2 +-
>  tests/ref/lavf/mxf_opatom            |    2 +-
>  tests/ref/lavf/mxf_opatom_audio      |    4 +--
>  tests/ref/seek/lavf-mxf              |   44 +++++++++++++--------------
>  tests/ref/seek/lavf-mxf_opatom_audio |   54 +++++++++++++++++-----------------
>  8 files changed, 107 insertions(+), 72 deletions(-)
> 
> [..]

> @@ -2038,6 +2051,9 @@ static int mxf_write_header(AVFormatContext *s)
>          return -1;
>      }
>  
> +    if (!av_dict_get(s->metadata, "comment_", NULL, AV_DICT_IGNORE_SUFFIX))
> +        mxf->store_user_comments = 0;
> +
>      for (i = 0; i < s->nb_streams; i++) {
>          AVStream *st = s->streams[i];
>          MXFStreamContext *sc = av_mallocz(sizeof(*sc));
> @@ -2650,12 +2666,14 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int
>      { "smpte349m", "SMPTE 349M (1485 Mbps mappings)",\
>        0, AV_OPT_TYPE_CONST, {.i64 = 6}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
>      { "smpte428", "SMPTE 428-1 DCDM",\
> -      0, AV_OPT_TYPE_CONST, {.i64 = 7}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},
> +      0, AV_OPT_TYPE_CONST, {.i64 = 7}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\

Stray \ from previous patch attempt?

>  
>  
>  
>  static const AVOption mxf_options[] = {
>      MXF_COMMON_OPTIONS
> +    { "store_user_comments", "",
> +      offsetof(MXFContext, store_user_comments), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
>      { NULL },
>  };
>  
> @@ -2670,6 +2688,8 @@ static const AVOption d10_options[] = {
>      { "d10_channelcount", "Force/set channelcount in generic sound essence descriptor",
>        offsetof(MXFContext, channel_count), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 8, AV_OPT_FLAG_ENCODING_PARAM},
>      MXF_COMMON_OPTIONS
> +    { "store_user_comments", "",
> +      offsetof(MXFContext, store_user_comments), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
>      { NULL },
>  };
>  
> diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
> [..]


-- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83


More information about the ffmpeg-devel mailing list