summaryrefslogtreecommitdiffstats
path: root/mpvcore/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-16 20:40:02 +0100
committerwm4 <wm4@nowhere>2013-12-16 20:41:08 +0100
commit7dc7b900c622235d595337c988a0c75280084b7c (patch)
tree7f896555c9478430edd28d56fb6fde5691b0e643 /mpvcore/player
parent3e6cd3ef19aca7c79dfc73412f98b70b7de011b4 (diff)
downloadmpv-7dc7b900c622235d595337c988a0c75280084b7c.tar.bz2
mpv-7dc7b900c622235d595337c988a0c75280084b7c.tar.xz
Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsg
The tmsg stuff was for the internal gettext() based translation system, which nobody ever attempted to use and thus was removed. mp_gtext() and set_osd_tmsg() were also for this. mp_dbg was once enabled in debug mode only, but since we have log level for enabling debug messages, it seems utterly useless.
Diffstat (limited to 'mpvcore/player')
-rw-r--r--mpvcore/player/command.c24
-rw-r--r--mpvcore/player/configfiles.c8
-rw-r--r--mpvcore/player/main.c2
-rw-r--r--mpvcore/player/mp_core.h2
-rw-r--r--mpvcore/player/osd.c13
-rw-r--r--mpvcore/player/playloop.c6
-rw-r--r--mpvcore/player/screenshot.c2
-rw-r--r--mpvcore/player/sub.c4
8 files changed, 25 insertions, 36 deletions
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);