From 8f60de98beef61c3631819a4e3a4be1ec56da00d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 11 Jun 2014 02:04:02 +0200 Subject: encode: make option struct local Similar to previous commits. --- player/configfiles.c | 4 +++- player/main.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'player') diff --git a/player/configfiles.c b/player/configfiles.c index 9b20f5af71..2794ddaebf 100644 --- a/player/configfiles.c +++ b/player/configfiles.c @@ -32,6 +32,7 @@ #include "osdep/io.h" #include "common/global.h" +#include "common/encode.h" #include "common/msg.h" #include "options/path.h" #include "options/m_config.h" @@ -58,7 +59,8 @@ bool mp_parse_cfgfiles(struct MPContext *mpctx) bool r = true; char *conffile; char *section = NULL; - bool encoding = opts->encode_output.file && *opts->encode_output.file; + bool encoding = opts->encode_opts && + opts->encode_opts->file && opts->encode_opts->file[0]; // In encoding mode, we don't want to apply normal config options. // So we "divert" normal options into a separate section, and the diverted // section is never used - unless maybe it's explicitly referenced from an diff --git a/player/main.c b/player/main.c index 19c24c036b..e2672a744e 100644 --- a/player/main.c +++ b/player/main.c @@ -236,7 +236,7 @@ static bool handle_help_options(struct MPContext *mpctx) opt_exit = 1; } #if HAVE_ENCODING - if (encode_lavc_showhelp(log, &opts->encode_output)) + if (encode_lavc_showhelp(log, opts->encode_opts)) opt_exit = 1; #endif return opt_exit; @@ -383,8 +383,8 @@ int mp_initialize(struct MPContext *mpctx) mp_dispatch_set_wakeup_fn(mpctx->dispatch, wakeup_playloop, mpctx); #if HAVE_ENCODING - if (opts->encode_output.file && *opts->encode_output.file) { - mpctx->encode_lavc_ctx = encode_lavc_init(&opts->encode_output, + if (opts->encode_opts->file && opts->encode_opts->file[0]) { + mpctx->encode_lavc_ctx = encode_lavc_init(opts->encode_opts, mpctx->global); if(!mpctx->encode_lavc_ctx) { MP_INFO(mpctx, "Encoding initialization failed."); -- cgit v1.2.3