diff options
author | Rudolf Polzer <divVerent@xonotic.org> | 2014-04-14 20:29:23 +0200 |
---|---|---|
committer | Rudolf Polzer <divVerent@xonotic.org> | 2014-04-14 20:33:35 +0200 |
commit | a7c6c4656de1938729d27fb6f02b7e46a71c35fb (patch) | |
tree | 9531758c097f27a71f98268681de8fbaf3f9ef49 | |
parent | 7178257bb69ca7bf597efbf2e2f35dd2628ff199 (diff) | |
download | mpv-a7c6c4656de1938729d27fb6f02b7e46a71c35fb.tar.bz2 mpv-a7c6c4656de1938729d27fb6f02b7e46a71c35fb.tar.xz |
New option --no-ometadata to opt out of including metadata when encoding.
This re-allows the previous behaviour of being able to reencode with
metadata removed, which is useful when encoding "inconsistently" tagged
data for a device/player that shows file names when tags are not
present.
-rw-r--r-- | DOCS/man/en/encode.rst | 4 | ||||
-rw-r--r-- | common/encode_lavc.c | 3 | ||||
-rw-r--r-- | options/options.c | 4 | ||||
-rw-r--r-- | options/options.h | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/DOCS/man/en/encode.rst b/DOCS/man/en/encode.rst index 3608bfa896..b0d5ca3808 100644 --- a/DOCS/man/en/encode.rst +++ b/DOCS/man/en/encode.rst @@ -149,3 +149,7 @@ You can encode files from one format/codec to another using this facility. container formats, e.g. AVI). In this mode, discontinuities are not fixed and all pts are passed through as-is. Never seek backwards or use multiple input files in this mode! + +``--no-ometadata`` + Turns off copying of metadata from input files to output files when + encoding (which is enabled by default). diff --git a/common/encode_lavc.c b/common/encode_lavc.c index 39e5607e41..78bbfeb84d 100644 --- a/common/encode_lavc.c +++ b/common/encode_lavc.c @@ -247,7 +247,8 @@ struct encode_lavc_context *encode_lavc_init(struct encode_output_conf *options, void encode_lavc_set_metadata(struct encode_lavc_context *ctx, struct mp_tags *metadata) { - ctx->metadata = metadata; + if (ctx->options->metadata) + ctx->metadata = metadata; } int encode_lavc_start(struct encode_lavc_context *ctx) diff --git a/options/options.c b/options/options.c index 42ca0846d9..82b81b049d 100644 --- a/options/options.c +++ b/options/options.c @@ -635,6 +635,7 @@ const m_option_t mp_opts[] = { OPT_FLAG("oneverdrop", encode_output.neverdrop, CONF_GLOBAL), OPT_FLAG("ovfirst", encode_output.video_first, CONF_GLOBAL), OPT_FLAG("oafirst", encode_output.audio_first, CONF_GLOBAL), + OPT_FLAG("ometadata", encode_output.metadata, CONF_GLOBAL), #endif {NULL, NULL, 0, 0, 0, 0, NULL} @@ -766,6 +767,9 @@ const struct MPOpts mp_default_opts = { #endif .default_bindings = 1, }, + .encode_output = { + .metadata = 1, + }, }; #endif /* MPLAYER_CFG_MPLAYER_H */ diff --git a/options/options.h b/options/options.h index 3b9ddeedc7..3572789c5a 100644 --- a/options/options.h +++ b/options/options.h @@ -302,6 +302,7 @@ typedef struct MPOpts { int neverdrop; int video_first; int audio_first; + int metadata; } encode_output; } MPOpts; |