diff options
Diffstat (limited to 'mpvcore')
-rw-r--r-- | mpvcore/input/joystick.c | 18 | ||||
-rw-r--r-- | mpvcore/input/lirc.c | 6 | ||||
-rw-r--r-- | mpvcore/m_config.c | 28 | ||||
-rw-r--r-- | mpvcore/m_option.c | 15 | ||||
-rw-r--r-- | mpvcore/m_property.c | 4 | ||||
-rw-r--r-- | mpvcore/mp_msg.h | 6 | ||||
-rw-r--r-- | mpvcore/parser-mpcmd.c | 10 | ||||
-rw-r--r-- | mpvcore/player/command.c | 24 | ||||
-rw-r--r-- | mpvcore/player/configfiles.c | 8 | ||||
-rw-r--r-- | mpvcore/player/main.c | 2 | ||||
-rw-r--r-- | mpvcore/player/mp_core.h | 2 | ||||
-rw-r--r-- | mpvcore/player/osd.c | 13 | ||||
-rw-r--r-- | mpvcore/player/playloop.c | 6 | ||||
-rw-r--r-- | mpvcore/player/screenshot.c | 2 | ||||
-rw-r--r-- | mpvcore/player/sub.c | 4 |
15 files changed, 67 insertions, 81 deletions
diff --git a/mpvcore/input/joystick.c b/mpvcore/input/joystick.c index 2ab38f6311..d8e9d13423 100644 --- a/mpvcore/input/joystick.c +++ b/mpvcore/input/joystick.c @@ -51,11 +51,11 @@ int mp_input_joystick_init(char* dev) { int initialized = 0; struct js_event ev; - mp_tmsg(MSGT_INPUT,MSGL_V,"Opening joystick device %s\n",dev ? dev : JS_DEV); + mp_msg(MSGT_INPUT,MSGL_V,"Opening joystick device %s\n",dev ? dev : JS_DEV); fd = open( dev ? dev : JS_DEV , O_RDONLY | O_NONBLOCK ); if(fd < 0) { - mp_tmsg(MSGT_INPUT,MSGL_ERR,"Can't open joystick device %s: %s\n",dev ? dev : JS_DEV,strerror(errno)); + mp_msg(MSGT_INPUT,MSGL_ERR,"Can't open joystick device %s: %s\n",dev ? dev : JS_DEV,strerror(errno)); return -1; } @@ -70,7 +70,7 @@ int mp_input_joystick_init(char* dev) { initialized = 1; break; } - mp_tmsg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n",strerror(errno)); + mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n",strerror(errno)); close(fd); return -1; } @@ -78,7 +78,7 @@ int mp_input_joystick_init(char* dev) { } if((unsigned int)l < sizeof(struct js_event)) { if(l > 0) - mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick: We lose %d bytes of data\n",l); + mp_msg(MSGT_INPUT,MSGL_WARN,"Joystick: We lose %d bytes of data\n",l); break; } if(ev.type == JS_EVENT_BUTTON) @@ -102,9 +102,9 @@ int mp_input_joystick_read(void *ctx, int fd) { else if(errno == EAGAIN) return MP_INPUT_NOTHING; if( r < 0) - mp_tmsg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n",strerror(errno)); + mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n",strerror(errno)); else - mp_tmsg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n","EOF"); + mp_msg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n","EOF"); return MP_INPUT_DEAD; } l += r; @@ -112,12 +112,12 @@ int mp_input_joystick_read(void *ctx, int fd) { if((unsigned int)l < sizeof(struct js_event)) { if(l > 0) - mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick: We lose %d bytes of data\n",l); + mp_msg(MSGT_INPUT,MSGL_WARN,"Joystick: We lose %d bytes of data\n",l); return MP_INPUT_NOTHING; } if(ev.type & JS_EVENT_INIT) { - mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick: warning init event, we have lost sync with driver.\n"); + mp_msg(MSGT_INPUT,MSGL_WARN,"Joystick: warning init event, we have lost sync with driver.\n"); ev.type &= ~JS_EVENT_INIT; if(ev.type == JS_EVENT_BUTTON) { int s = (btns >> ev.number) & 1; @@ -154,7 +154,7 @@ int mp_input_joystick_read(void *ctx, int fd) { } else return MP_INPUT_NOTHING; } else { - mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick warning unknown event type %d\n",ev.type); + mp_msg(MSGT_INPUT,MSGL_WARN,"Joystick warning unknown event type %d\n",ev.type); return MP_INPUT_ERROR; } diff --git a/mpvcore/input/lirc.c b/mpvcore/input/lirc.c index 059d548f95..052fffbd74 100644 --- a/mpvcore/input/lirc.c +++ b/mpvcore/input/lirc.c @@ -40,9 +40,9 @@ mp_input_lirc_init(void) { int lirc_sock; int mode; - mp_tmsg(MSGT_LIRC,MSGL_V,"Setting up LIRC support...\n"); + mp_msg(MSGT_LIRC,MSGL_V,"Setting up LIRC support...\n"); if((lirc_sock=lirc_init("mpv",0))==-1){ - mp_tmsg(MSGT_LIRC,MSGL_V,"Failed to open LIRC support. You will not be able to use your remote control.\n"); + mp_msg(MSGT_LIRC,MSGL_V,"Failed to open LIRC support. You will not be able to use your remote control.\n"); return -1; } @@ -55,7 +55,7 @@ mp_input_lirc_init(void) { } if(lirc_readconfig( lirc_configfile,&lirc_config,NULL )!=0 ){ - mp_tmsg(MSGT_LIRC,MSGL_ERR,"Failed to read LIRC config file %s.\n", + mp_msg(MSGT_LIRC,MSGL_ERR,"Failed to read LIRC config file %s.\n", lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile); lirc_deinit(); return -1; diff --git a/mpvcore/m_config.c b/mpvcore/m_config.c index 851b54489e..203796055f 100644 --- a/mpvcore/m_config.c +++ b/mpvcore/m_config.c @@ -75,11 +75,11 @@ static int parse_profile(struct m_config *config, const struct m_option *opt, if (!bstrcmp0(param, "help")) { struct m_profile *p; if (!config->profiles) { - mp_tmsg(MSGT_CFGPARSER, MSGL_INFO, + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "No profiles have been defined.\n"); return M_OPT_EXIT - 1; } - mp_tmsg(MSGT_CFGPARSER, MSGL_INFO, "Available profiles:\n"); + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "Available profiles:\n"); for (p = config->profiles; p; p = p->next) mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\t%s\t%s\n", p->name, p->desc ? p->desc : ""); @@ -96,7 +96,7 @@ static int parse_profile(struct m_config *config, const struct m_option *opt, for (int i = 0; list[i]; i++) { struct m_profile *p = m_config_get_profile0(config, list[i]); if (!p) { - mp_tmsg(MSGT_CFGPARSER, MSGL_WARN, "Unknown profile '%s'.\n", + mp_msg(MSGT_CFGPARSER, MSGL_WARN, "Unknown profile '%s'.\n", list[i]); r = M_OPT_INVALID; } else if (set) @@ -113,12 +113,12 @@ static int show_profile(struct m_config *config, bstr param) if (!param.len) return M_OPT_MISSING_PARAM; if (!(p = m_config_get_profile(config, param))) { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Unknown profile '%.*s'.\n", + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Unknown profile '%.*s'.\n", BSTR_P(param)); return M_OPT_EXIT - 1; } if (!config->profile_depth) - mp_tmsg(MSGT_CFGPARSER, MSGL_INFO, "Profile %s: %s\n", p->name, + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "Profile %s: %s\n", p->name, p->desc ? p->desc : ""); config->profile_depth++; for (i = 0; i < p->num_opts; i++) { @@ -284,7 +284,7 @@ void m_config_backup_opt(struct m_config *config, const char *opt) if (co) { ensure_backup(config, co); } else { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Option %s not found.\n", opt); + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %s not found.\n", opt); } } @@ -496,14 +496,14 @@ static int m_config_parse_option(struct m_config *config, struct bstr name, // Check if this option isn't forbidden in the current mode if ((flags & M_SETOPT_FROM_CONFIG_FILE) && (co->opt->flags & M_OPT_NOCFG)) { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %.*s option can't be used in a config file.\n", BSTR_P(name)); return M_OPT_INVALID; } if (flags & M_SETOPT_BACKUP) { if (co->opt->flags & M_OPT_GLOBAL) { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %.*s option is global and can't be set per-file.\n", BSTR_P(name)); return M_OPT_INVALID; @@ -563,7 +563,7 @@ static int parse_subopts(struct m_config *config, char *name, char *prefix, r = m_config_parse_option(config,bstr0(n), bstr0(lst[2 * i + 1]), flags); if (r < 0) { if (r > M_OPT_EXIT) { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Error parsing suboption %s/%s (%s)\n", name, lst[2 * i], m_option_strerror(r)); r = M_OPT_INVALID; @@ -582,7 +582,7 @@ int m_config_parse_suboptions(struct m_config *config, char *name, return 0; int r = parse_subopts(config, name, "", bstr0(subopts), 0); if (r < 0 && r > M_OPT_EXIT) { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Error parsing suboption %s (%s)\n", + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Error parsing suboption %s (%s)\n", name, m_option_strerror(r)); r = M_OPT_INVALID; } @@ -594,7 +594,7 @@ int m_config_set_option_ext(struct m_config *config, struct bstr name, { int r = m_config_parse_option(config, name, param, flags); if (r < 0 && r > M_OPT_EXIT) { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Error parsing option %.*s (%s)\n", + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Error parsing option %.*s (%s)\n", BSTR_P(name), m_option_strerror(r)); r = M_OPT_INVALID; } @@ -633,7 +633,7 @@ void m_config_print_option_list(const struct m_config *config) int count = 0; const char *prefix = config->is_toplevel ? "--" : ""; - mp_tmsg(MSGT_CFGPARSER, MSGL_INFO, "Options:\n\n"); + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "Options:\n\n"); for (int i = 0; i < config->num_opts; i++) { struct m_config_option *co = &config->opts[i]; const struct m_option *opt = co->opt; @@ -675,7 +675,7 @@ void m_config_print_option_list(const struct m_config *config) mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\n"); count++; } - mp_tmsg(MSGT_CFGPARSER, MSGL_INFO, "\nTotal: %d options\n", count); + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\nTotal: %d options\n", count); } struct m_profile *m_config_get_profile(const struct m_config *config, bstr name) @@ -731,7 +731,7 @@ void m_config_set_profile(struct m_config *config, struct m_profile *p, int flags) { if (config->profile_depth > MAX_PROFILE_DEPTH) { - mp_tmsg(MSGT_CFGPARSER, MSGL_WARN, + mp_msg(MSGT_CFGPARSER, MSGL_WARN, "WARNING: Profile inclusion too deep.\n"); return; } diff --git a/mpvcore/m_option.c b/mpvcore/m_option.c index 066500cd71..85ac974861 100644 --- a/mpvcore/m_option.c +++ b/mpvcore/m_option.c @@ -45,18 +45,18 @@ char *m_option_strerror(int code) { switch (code) { case M_OPT_UNKNOWN: - return mp_gtext("option not found"); + return "option not found"; case M_OPT_MISSING_PARAM: - return mp_gtext("option requires parameter"); + return "option requires parameter"; case M_OPT_INVALID: - return mp_gtext("option parameter could not be parsed"); + return "option parameter could not be parsed"; case M_OPT_OUT_OF_RANGE: - return mp_gtext("parameter is outside values allowed for option"); + return "parameter is outside values allowed for option"; case M_OPT_DISALLOW_PARAM: - return mp_gtext("option doesn't take a parameter"); + return "option doesn't take a parameter"; case M_OPT_PARSER_ERR: default: - return mp_gtext("parser error"); + return "parser error"; } } @@ -1161,7 +1161,8 @@ static int parse_print(const m_option_t *opt, struct bstr name, struct bstr param, void *dst) { if (opt->type == CONF_TYPE_PRINT) { - mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", mp_gtext(opt->p)); + const char *msg = opt->p; + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "%s", msg); } else { char *name0 = bstrdup0(NULL, name); char *param0 = bstrdup0(NULL, param); diff --git a/mpvcore/m_property.c b/mpvcore/m_property.c index 4ae33c9d1e..aba9ca4ec8 100644 --- a/mpvcore/m_property.c +++ b/mpvcore/m_property.c @@ -306,7 +306,7 @@ void m_properties_print_help_list(const m_option_t *list) char min[50], max[50]; int i, count = 0; - mp_tmsg(MSGT_CFGPARSER, MSGL_INFO, + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\n Name Type Min Max\n\n"); for (i = 0; list[i].name; i++) { const m_option_t *opt = &list[i]; @@ -326,7 +326,7 @@ void m_properties_print_help_list(const m_option_t *list) max); count++; } - mp_tmsg(MSGT_CFGPARSER, MSGL_INFO, "\nTotal: %d properties\n", count); + mp_msg(MSGT_CFGPARSER, MSGL_INFO, "\nTotal: %d properties\n", count); } int m_property_int_ro(const m_option_t *prop, int action, diff --git a/mpvcore/mp_msg.h b/mpvcore/mp_msg.h index 306b8145e1..976ed5e3f8 100644 --- a/mpvcore/mp_msg.h +++ b/mpvcore/mp_msg.h @@ -137,13 +137,9 @@ bool mp_msg_test_log(struct mp_log *log, int lev); #include "config.h" #include "mpvcore/mp_common.h" -#define mp_gtext(x) ((char*)(x)) - // Note: using mp_msg_log or the MP_ERR/... macros is preferred. void mp_msg_va(int mod, int lev, const char *format, va_list va); void mp_msg(int mod, int lev, const char *format, ... ) PRINTF_ATTRIBUTE(3, 4); -#define mp_tmsg mp_msg -#define mp_dbg mp_msg struct mp_log *mp_log_new(void *talloc_ctx, struct mp_log *parent, const char *name); @@ -170,7 +166,7 @@ void mp_msg_log(struct mp_log *log, int lev, const char *format, ...) #define mp_warn(log, ...) mp_msg_log(log, MSGL_WARN, __VA_ARGS__) #define mp_info(log, ...) mp_msg_log(log, MSGL_INFO, __VA_ARGS__) #define mp_verbose(log, ...) mp_msg_log(log, MSGL_V, __VA_ARGS__) -//#define mp_dbg(log, ...) mp_msg_log(log, MSGL_DBG2, __VA_ARGS__) +#define mp_dbg(log, ...) mp_msg_log(log, MSGL_DBG2, __VA_ARGS__) #define mp_trace(log, ...) mp_msg_log(log, MSGL_DBG5, __VA_ARGS__) struct mpv_global; diff --git a/mpvcore/parser-mpcmd.c b/mpvcore/parser-mpcmd.c index 6890e94fe0..97398954cc 100644 --- a/mpvcore/parser-mpcmd.c +++ b/mpvcore/parser-mpcmd.c @@ -104,7 +104,7 @@ static bool split_opt(struct parse_state *p) return r == 0; p->error = true; - mp_tmsg(MSGT_CFGPARSER, MSGL_FATAL, + mp_msg(MSGT_CFGPARSER, MSGL_FATAL, "Error parsing commandline option %.*s: %s\n", BSTR_P(p->arg), m_option_strerror(r)); return false; @@ -138,7 +138,7 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, goto err_out; } if (r < 0) { - mp_tmsg(MSGT_CFGPARSER, MSGL_FATAL, + mp_msg(MSGT_CFGPARSER, MSGL_FATAL, "Setting commandline option --%.*s=%.*s failed.\n", BSTR_P(p.arg), BSTR_P(p.param)); goto err_out; @@ -192,7 +192,7 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, struct playlist *pl = playlist_parse_file(param0, opts); talloc_free(param0); if (!pl) { - mp_tmsg(MSGT_CFGPARSER, MSGL_FATAL, + mp_msg(MSGT_CFGPARSER, MSGL_FATAL, "Error reading playlist '%.*s'", BSTR_P(p.param)); goto err_out; } @@ -233,7 +233,7 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, playlist_add_file(files, f); } } else - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Invalid play entry %s\n", file0); } else // dvd:// or dvd://x entry @@ -252,7 +252,7 @@ int m_config_parse_mp_command_line(m_config_t *config, struct playlist *files, goto err_out; if (mode != GLOBAL) { - mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, + mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Missing closing --} on command line.\n"); goto err_out; } diff --git a/mpvcore/player/command.c b/mpvcore/player/command.c index e36675bf05..10dfb4c261 100644 --- a/mpvcore/player/command.c +++ b/mpvcore/player/command.c @@ -1022,7 +1022,7 @@ static int property_switch_track(m_option_t *prop, int action, void *arg, else { char *lang = track->lang; if (!lang) - lang = mp_gtext("unknown"); + lang = "unknown"; if (track->title) *(char **)arg = talloc_asprintf(NULL, "(%d) %s (\"%s\")", @@ -2148,7 +2148,7 @@ static void show_property_osd(MPContext *mpctx, const char *pname, int osd_mode) for (p = property_osd_display; p->name; p++) { if (!strcmp(p->name, prop.name)) { osd_progbar = p->seek_bar ? 1 : p->osd_progbar; - osd_name = p->seek_msg ? "" : mp_gtext(p->osd_name); + osd_name = p->seek_msg ? "" : p->osd_name; break; } } @@ -2215,7 +2215,7 @@ static void show_property_osd(MPContext *mpctx, const char *pname, int osd_mode) int index = p - property_osd_display; osd_id = p->osd_id ? p->osd_id : OSD_MSG_PROPERTY + index; } - set_osd_tmsg(mpctx, osd_id, 1, opts->osd_duration, "%s", osd_msg); + set_osd_msg(mpctx, osd_id, 1, opts->osd_duration, "%s", osd_msg); } talloc_free(tmp); @@ -2314,7 +2314,7 @@ static int edit_filters_osd(struct MPContext *mpctx, enum stream_type mediatype, const char *prop = filter_opt[mediatype]; show_property_osd(mpctx, prop, MP_ON_OSD_MSG); } else { - set_osd_tmsg(mpctx, OSD_MSG_TEXT, 1, mpctx->opts->osd_duration, + set_osd_msg(mpctx, OSD_MSG_TEXT, 1, mpctx->opts->osd_duration, "Changing filters failed!"); } } @@ -2729,7 +2729,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (cmd->id == MP_CMD_SUB_STEP) { opts->sub_delay += a[0]; osd_changed_all(mpctx->osd); - set_osd_tmsg(mpctx, OSD_MSG_SUB_DELAY, osdl, osd_duration, + set_osd_msg(mpctx, OSD_MSG_SUB_DELAY, osdl, osd_duration, "Sub delay: %d ms", ROUND(opts->sub_delay * 1000)); } else { // We can easily get stuck by failing to seek to the video @@ -2760,7 +2760,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) else opts->osd_level = v > max ? max : v; if (msg_osd && opts->osd_level <= 1) - set_osd_tmsg(mpctx, OSD_MSG_OSD_STATUS, 0, osd_duration, + set_osd_msg(mpctx, OSD_MSG_OSD_STATUS, 0, osd_duration, "OSD: %s", opts->osd_level ? "yes" : "no"); else rm_osd_msg(mpctx, OSD_MSG_OSD_STATUS); @@ -2810,7 +2810,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) mp_set_playlist_entry(mpctx, e ? e : mpctx->playlist->first); } } else { - mp_tmsg(MSGT_CPLAYER, MSGL_ERR, + mp_msg(MSGT_CPLAYER, MSGL_ERR, "\nUnable to load playlist %s.\n", filename); } break; @@ -2877,7 +2877,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) else radio_step_channel(mpctx->stream, RADIO_CHANNEL_LOWER); if (radio_get_channel_name(mpctx->stream)) { - set_osd_tmsg(mpctx, OSD_MSG_RADIO_CHANNEL, osdl, osd_duration, + set_osd_msg(mpctx, OSD_MSG_RADIO_CHANNEL, osdl, osd_duration, "Channel: %s", radio_get_channel_name(mpctx->stream)); } @@ -2888,7 +2888,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (mpctx->stream && mpctx->stream->type == STREAMTYPE_RADIO) { radio_set_channel(mpctx->stream, cmd->args[0].v.s); if (radio_get_channel_name(mpctx->stream)) { - set_osd_tmsg(mpctx, OSD_MSG_RADIO_CHANNEL, osdl, osd_duration, + set_osd_msg(mpctx, OSD_MSG_RADIO_CHANNEL, osdl, osd_duration, "Channel: %s", radio_get_channel_name(mpctx->stream)); } @@ -2951,7 +2951,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) tv_step_channel(get_tvh(mpctx), TV_CHANNEL_LOWER); } if (tv_channel_list) { - set_osd_tmsg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, + set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "Channel: %s", tv_channel_current->name); } } @@ -2987,7 +2987,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (get_tvh(mpctx)) { tv_set_channel(get_tvh(mpctx), cmd->args[0].v.s); if (tv_channel_list) { - set_osd_tmsg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, + set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "Channel: %s", tv_channel_current->name); } } @@ -3018,7 +3018,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (get_tvh(mpctx)) { tv_last_channel(get_tvh(mpctx)); if (tv_channel_list) { - set_osd_tmsg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, + set_osd_msg(mpctx, OSD_MSG_TV_CHANNEL, osdl, osd_duration, "Channel: %s", tv_channel_current->name); } } diff --git a/mpvcore/player/configfiles.c b/mpvcore/player/configfiles.c index 21450b482d..ac95f6fdf4 100644 --- a/mpvcore/player/configfiles.c +++ b/mpvcore/player/configfiles.c @@ -95,7 +95,7 @@ void mp_load_per_protocol_config(m_config_t *conf, const char * const file) protocol[strlen(PROFILE_CFG_PROTOCOL) + strlen(file) - strlen(str)] = '\0'; p = m_config_get_profile0(conf, protocol); if (p) { - mp_tmsg(MSGT_CPLAYER, MSGL_INFO, + mp_msg(MSGT_CPLAYER, MSGL_INFO, "Loading protocol-related profile '%s'\n", protocol); m_config_set_profile(conf, p, FILE_LOCAL_FLAGS); } @@ -118,7 +118,7 @@ void mp_load_per_extension_config(m_config_t *conf, const char * const file) strncat(extension, ++str, 7); p = m_config_get_profile0(conf, extension); if (p) { - mp_tmsg(MSGT_CPLAYER, MSGL_INFO, + mp_msg(MSGT_CPLAYER, MSGL_INFO, "Loading extension-related profile '%s'\n", extension); m_config_set_profile(conf, p, FILE_LOCAL_FLAGS); } @@ -135,7 +135,7 @@ void mp_load_per_output_config(m_config_t *conf, char *cfg, char *out) sprintf(profile, "%s%s", cfg, out); p = m_config_get_profile0(conf, profile); if (p) { - mp_tmsg(MSGT_CPLAYER, MSGL_INFO, + mp_msg(MSGT_CPLAYER, MSGL_INFO, "Loading extension-related profile '%s'\n", profile); m_config_set_profile(conf, p, FILE_LOCAL_FLAGS); } @@ -149,7 +149,7 @@ static int try_load_config(m_config_t *conf, const char *file, int flags) { if (!mp_path_exists(file)) return 0; - mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "Loading config '%s'\n", file); + mp_msg(MSGT_CPLAYER, MSGL_INFO, "Loading config '%s'\n", file); m_config_parse_config_file(conf, file, flags); return 1; } diff --git a/mpvcore/player/main.c b/mpvcore/player/main.c index 1a3bd15fe1..685ae16792 100644 --- a/mpvcore/player/main.c +++ b/mpvcore/player/main.c @@ -366,7 +366,7 @@ static int mpv_main(int argc, char *argv[]) if (!mpctx->playlist->first && !opts->player_idle_mode) { mp_print_version(true); - MP_INFO(mpctx, "%s", mp_gtext(mp_help_text)); + MP_INFO(mpctx, "%s", mp_help_text); exit_player(mpctx, EXIT_NONE); } diff --git a/mpvcore/player/mp_core.h b/mpvcore/player/mp_core.h index 517ddbd37b..e1c7997907 100644 --- a/mpvcore/player/mp_core.h +++ b/mpvcore/player/mp_core.h @@ -408,8 +408,6 @@ void set_osd_bar(struct MPContext *mpctx, int type, const char* name, double min, double max, double val); void set_osd_msg(struct MPContext *mpctx, int id, int level, int time, const char* fmt, ...) PRINTF_ATTRIBUTE(5,6); -void set_osd_tmsg(struct MPContext *mpctx, int id, int level, int time, - const char* fmt, ...) PRINTF_ATTRIBUTE(5,6); void rm_osd_msg(struct MPContext *mpctx, int id); void set_osd_function(struct MPContext *mpctx, int osd_function); void set_osd_subtitle(struct MPContext *mpctx, const char *text); diff --git a/mpvcore/player/osd.c b/mpvcore/player/osd.c index 1674fcab8b..42409b555f 100644 --- a/mpvcore/player/osd.c +++ b/mpvcore/player/osd.c @@ -213,15 +213,6 @@ void set_osd_msg(struct MPContext *mpctx, int id, int level, int time, va_end(ap); } -void set_osd_tmsg(struct MPContext *mpctx, int id, int level, int time, - const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - set_osd_msg_va(mpctx, id, level, time, mp_gtext(fmt), ap); - va_end(ap); -} - /** * \brief Remove a message from the OSD stack * @@ -451,14 +442,14 @@ static void add_seek_osd_messages(struct MPContext *mpctx) } if (mpctx->add_osd_seek_info & OSD_SEEK_INFO_CHAPTER_TEXT) { char *chapter = chapter_display_name(mpctx, get_current_chapter(mpctx)); - set_osd_tmsg(mpctx, OSD_MSG_TEXT, 1, mpctx->opts->osd_duration, + set_osd_msg(mpctx, OSD_MSG_TEXT, 1, mpctx->opts->osd_duration, "Chapter: %s", chapter); talloc_free(chapter); } if ((mpctx->add_osd_seek_info & OSD_SEEK_INFO_EDITION) && mpctx->master_demuxer) { - set_osd_tmsg(mpctx, OSD_MSG_TEXT, 1, mpctx->opts->osd_duration, + set_osd_msg(mpctx, OSD_MSG_TEXT, 1, mpctx->opts->osd_duration, "Playing edition %d of %d.", mpctx->master_demuxer->edition + 1, mpctx->master_demuxer->num_editions); diff --git a/mpvcore/player/playloop.c b/mpvcore/player/playloop.c index b2eae3807c..dbc87a7ec6 100644 --- a/mpvcore/player/playloop.c +++ b/mpvcore/player/playloop.c @@ -606,7 +606,7 @@ static void update_avsync(struct MPContext *mpctx) mpctx->last_av_difference = MP_NOPTS_VALUE; if (mpctx->last_av_difference > 0.5 && mpctx->drop_frame_cnt > 50 && !mpctx->drop_message_shown) { - MP_WARN(mpctx, "%s", mp_gtext(av_desync_help_text)); + MP_WARN(mpctx, "%s", av_desync_help_text); mpctx->drop_message_shown = true; } } @@ -1017,7 +1017,7 @@ void run_playloop(struct MPContext *mpctx) } } - mp_dbg(MSGT_AVSYNC, MSGL_DBG2, "*** ftime=%5.3f ***\n", frame_time); + mp_msg(MSGT_AVSYNC, MSGL_DBG2, "*** ftime=%5.3f ***\n", frame_time); if (mpctx->d_video->vfilter && mpctx->d_video->vfilter->initialized < 0) { MP_FATAL(mpctx, "\nFATAL: Could not initialize video filters " @@ -1059,7 +1059,7 @@ void run_playloop(struct MPContext *mpctx) mpctx->time_frame -= get_relative_time(mpctx); if (full_audio_buffers && !mpctx->restart_playback) { buffered_audio = ao_get_delay(mpctx->ao); - mp_dbg(MSGT_AVSYNC, MSGL_DBG2, "delay=%f\n", buffered_audio); + mp_msg(MSGT_AVSYNC, MSGL_DBG2, "delay=%f\n", buffered_audio); if (opts->autosync) { /* Smooth reported playback position from AO by averaging diff --git a/mpvcore/player/screenshot.c b/mpvcore/player/screenshot.c index d719495f9e..7aaba5f05a 100644 --- a/mpvcore/player/screenshot.c +++ b/mpvcore/player/screenshot.c @@ -80,7 +80,7 @@ static void screenshot_msg(screenshot_ctx *ctx, int status, const char *msg, mp_msg(MSGT_CPLAYER, status == SMSG_ERR ? MSGL_ERR : MSGL_INFO, "%s\n", s); if (ctx->osd) { - set_osd_tmsg(ctx->mpctx, OSD_MSG_TEXT, 1, ctx->mpctx->opts->osd_duration, + set_osd_msg(ctx->mpctx, OSD_MSG_TEXT, 1, ctx->mpctx->opts->osd_duration, "%s", s); } diff --git a/mpvcore/player/sub.c b/mpvcore/player/sub.c index f514d3345b..26c8eebdb9 100644 --- a/mpvcore/player/sub.c +++ b/mpvcore/player/sub.c @@ -107,7 +107,7 @@ void update_subtitles(struct MPContext *mpctx) if (!demux_has_packet(sh_stream)) break; if (subpts_s > curpts_s) { - mp_dbg(MSGT_CPLAYER, MSGL_DBG2, + mp_msg(MSGT_CPLAYER, MSGL_DBG2, "Sub early: c_pts=%5.3f s_pts=%5.3f\n", curpts_s, subpts_s); // Libass handled subs can be fed to it in advance @@ -118,7 +118,7 @@ void update_subtitles(struct MPContext *mpctx) break; } struct demux_packet *pkt = demux_read_packet(sh_stream); - mp_dbg(MSGT_CPLAYER, MSGL_V, "Sub: c_pts=%5.3f s_pts=%5.3f " + mp_msg(MSGT_CPLAYER, MSGL_V, "Sub: c_pts=%5.3f s_pts=%5.3f " "duration=%5.3f len=%d\n", curpts_s, pkt->pts, pkt->duration, pkt->len); sub_decode(dec_sub, pkt); |