diff options
author | wm4 <wm4@nowhere> | 2013-12-22 14:33:15 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-22 14:35:45 +0100 |
commit | e6bea0ec5a5acfed719dfbd89a812a1aa31a9ac5 (patch) | |
tree | ce3a810bbe9b030fb858e6bd0aaf270ccf15446e /player/main.c | |
parent | 8b7048b7d54d7e1a163d6efc994dbd3792812334 (diff) | |
download | mpv-e6bea0ec5a5acfed719dfbd89a812a1aa31a9ac5.tar.bz2 mpv-e6bea0ec5a5acfed719dfbd89a812a1aa31a9ac5.tar.xz |
Don't include version.h from make options.c
I find this annoying. It's the reason common/version.c exists at all.
options.c did this for the user agent, which contains the version
number. Because not including version.h means you can't build the user
agent and use it in mp_default_opts anymore, do something rather awkward
in main.c to initialize the default user agent.
Diffstat (limited to 'player/main.c')
-rw-r--r-- | player/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/player/main.c b/player/main.c index 5183f56ea3..df74d4cb56 100644 --- a/player/main.c +++ b/player/main.c @@ -98,7 +98,8 @@ void mp_print_version(struct mp_log *log, int always) { int v = always ? MSGL_INFO : MSGL_V; mp_msg(log, v, - "%s (C) 2000-2013 mpv/MPlayer/mplayer2 projects\n built on %s\n", mplayer_version, mplayer_builddate); + "%s (C) 2000-2013 mpv/MPlayer/mplayer2 projects\n built on %s\n", + mpv_version, mpv_builddate); print_libav_versions(log, v); mp_msg(log, v, "\n"); } @@ -300,9 +301,13 @@ static int mpv_main(int argc, char *argv[]) mpctx->log = mp_log_new(mpctx, mpctx->global->log, "!cplayer"); mpctx->statusline = mp_log_new(mpctx, mpctx->log, "!statusline"); + struct MPOpts *def_opts = talloc_ptrtype(mpctx, def_opts); + *def_opts = mp_default_opts; + def_opts->network_useragent = (char *)mpv_version; + // Create the config context and register the options mpctx->mconfig = m_config_new(mpctx, mpctx->log, sizeof(struct MPOpts), - &mp_default_opts, mp_opts); + def_opts, mp_opts); mpctx->opts = mpctx->mconfig->optstruct; mpctx->mconfig->includefunc = cfg_include; mpctx->mconfig->includefunc_ctx = mpctx; |