player: replace some overlooked mp_msgs

There are still some using IDENTIFY, and some without context in
configfiles.c.
This commit is contained in:
wm4 2013-12-19 21:28:55 +01:00
parent 7a8207a3fb
commit 5e0c4ec3e8
8 changed files with 31 additions and 42 deletions

View File

@ -1146,8 +1146,7 @@ static int mp_property_program(m_option_t *prop, int action, void *arg,
return M_PROPERTY_ERROR; return M_PROPERTY_ERROR;
if (prog.aid < 0 && prog.vid < 0) { if (prog.aid < 0 && prog.vid < 0) {
mp_msg(MSGT_CPLAYER, MSGL_ERR, MP_ERR(mpctx, "Selected program contains no audio or video streams!\n");
"Selected program contains no audio or video streams!\n");
return M_PROPERTY_ERROR; return M_PROPERTY_ERROR;
} }
mp_switch_track(mpctx, STREAM_VIDEO, mp_switch_track(mpctx, STREAM_VIDEO,
@ -2594,9 +2593,8 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
s.inc = cmd->args[1].v.d * cmd->scale; s.inc = cmd->args[1].v.d * cmd->scale;
char *property = cmd->args[0].v.s; char *property = cmd->args[0].v.s;
if (cmd->repeated && !check_property_autorepeat(property, mpctx)) { if (cmd->repeated && !check_property_autorepeat(property, mpctx)) {
mp_msg(MSGT_CPLAYER, MSGL_V, MP_VERBOSE(mpctx, "Dropping command '%.*s' from auto-repeated key.\n",
"Dropping command '%.*s' from auto-repeated key.\n", BSTR_P(cmd->original));
BSTR_P(cmd->original));
break; break;
} }
int r = mp_property_do(property, M_PROPERTY_SWITCH, &s, mpctx); int r = mp_property_do(property, M_PROPERTY_SWITCH, &s, mpctx);
@ -2670,15 +2668,12 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
int r = mp_property_do(cmd->args[0].v.s, M_PROPERTY_GET_STRING, int r = mp_property_do(cmd->args[0].v.s, M_PROPERTY_GET_STRING,
&tmp, mpctx); &tmp, mpctx);
if (r <= 0) { if (r <= 0) {
mp_msg(MSGT_CPLAYER, MSGL_WARN, MP_WARN(mpctx, "Failed to get value of property '%s'.\n",
"Failed to get value of property '%s'.\n", cmd->args[0].v.s);
cmd->args[0].v.s); MP_INFO(mpctx, "ANS_ERROR=%s\n", property_error_string(r));
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n",
property_error_string(r));
break; break;
} }
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_%s=%s\n", MP_INFO(mpctx, "ANS_%s=%s\n", cmd->args[0].v.s, tmp);
cmd->args[0].v.s, tmp);
talloc_free(tmp); talloc_free(tmp);
break; break;
} }
@ -2767,7 +2762,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
} }
case MP_CMD_PRINT_TEXT: { case MP_CMD_PRINT_TEXT: {
mp_msg(MSGT_GLOBAL, MSGL_INFO, "%s\n", cmd->args[0].v.s); MP_INFO(mpctx, "%s\n", cmd->args[0].v.s);
break; break;
} }
@ -2809,8 +2804,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
mp_set_playlist_entry(mpctx, e ? e : mpctx->playlist->first); mp_set_playlist_entry(mpctx, e ? e : mpctx->playlist->first);
} }
} else { } else {
mp_msg(MSGT_CPLAYER, MSGL_ERR, MP_ERR(mpctx, "Unable to load playlist %s.\n", filename);
"\nUnable to load playlist %s.\n", filename);
} }
break; break;
} }
@ -3073,8 +3067,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
case MP_CMD_VO_CMDLINE: case MP_CMD_VO_CMDLINE:
if (mpctx->video_out) { if (mpctx->video_out) {
char *s = cmd->args[0].v.s; char *s = cmd->args[0].v.s;
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Setting vo cmd line to '%s'.\n", MP_INFO(mpctx, "Setting vo cmd line to '%s'.\n", s);
s);
if (vo_control(mpctx->video_out, VOCTRL_SET_COMMAND_LINE, s) > 0) { if (vo_control(mpctx->video_out, VOCTRL_SET_COMMAND_LINE, s) > 0) {
set_osd_msg(mpctx, OSD_MSG_TEXT, osdl, osd_duration, "vo='%s'", s); set_osd_msg(mpctx, OSD_MSG_TEXT, osdl, osd_duration, "vo='%s'", s);
} else { } else {
@ -3125,8 +3118,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
break; break;
default: default:
mp_msg(MSGT_CPLAYER, MSGL_V, MP_VERBOSE(mpctx, "Received unknown cmd %s\n", cmd->name);
"Received unknown cmd %s\n", cmd->name);
} }
if (cmd->flags & MP_PAUSING) if (cmd->flags & MP_PAUSING)

View File

@ -95,9 +95,9 @@ static int mp_cpcall(lua_State *L, lua_CFunction fn, int args)
static void report_error(lua_State *L) static void report_error(lua_State *L)
{ {
struct MPContext *mpctx = get_mpctx(L);
const char *err = lua_tostring(L, -1); const char *err = lua_tostring(L, -1);
mp_msg(MSGT_CPLAYER, MSGL_WARN, "[lua] Error: %s\n", MP_WARN(mpctx, "Error: %s\n", err ? err : "[unknown]");
err ? err : "[unknown]");
lua_pop(L, 1); lua_pop(L, 1);
} }
@ -354,8 +354,8 @@ void mp_lua_script_dispatch(struct MPContext *mpctx, char *script_name,
{ {
struct script_ctx *ctx = find_script(mpctx->lua_ctx, script_name); struct script_ctx *ctx = find_script(mpctx->lua_ctx, script_name);
if (!ctx) { if (!ctx) {
mp_msg(MSGT_CPLAYER, MSGL_V, MP_VERBOSE(mpctx, "Can't find script '%s' when handling input.\n",
"Can't find script '%s' when handling input.\n", script_name); script_name);
return; return;
} }
lua_State *L = ctx->state; lua_State *L = ctx->state;

View File

@ -210,7 +210,7 @@ static bool handle_help_options(struct MPContext *mpctx)
#if HAVE_X11 #if HAVE_X11
if (opts->vo.fstype_list && strcmp(opts->vo.fstype_list[0], "help") == 0) { if (opts->vo.fstype_list && strcmp(opts->vo.fstype_list[0], "help") == 0) {
fstype_help(); fstype_help();
mp_msg(MSGT_FIXME, MSGL_FIXME, "\n"); MP_INFO(mpctx, "\n");
opt_exit = 1; opt_exit = 1;
} }
#endif #endif
@ -379,7 +379,7 @@ static int mpv_main(int argc, char *argv[])
if (opts->encode_output.file && *opts->encode_output.file) { if (opts->encode_output.file && *opts->encode_output.file) {
mpctx->encode_lavc_ctx = encode_lavc_init(&opts->encode_output); mpctx->encode_lavc_ctx = encode_lavc_init(&opts->encode_output);
if(!mpctx->encode_lavc_ctx) { if(!mpctx->encode_lavc_ctx) {
mp_msg(MSGT_VO, MSGL_INFO, "Encoding initialization failed."); MP_INFO(mpctx, "Encoding initialization failed.");
exit_player(mpctx, EXIT_ERROR); exit_player(mpctx, EXIT_ERROR);
} }
m_config_set_option0(mpctx->mconfig, "vo", "lavc"); m_config_set_option0(mpctx->mconfig, "vo", "lavc");

View File

@ -72,14 +72,13 @@ void write_status_line(struct MPContext *mpctx, const char *line)
{ {
struct MPOpts *opts = mpctx->opts; struct MPOpts *opts = mpctx->opts;
if (opts->slave_mode) { if (opts->slave_mode) {
mp_msg(MSGT_STATUSLINE, MSGL_STATUS, "%s\n", line); MP_MSG(mpctx, MSGL_STATUS, "%s\n", line);
} else if (erase_to_end_of_line) { } else if (erase_to_end_of_line) {
mp_msg(MSGT_STATUSLINE, MSGL_STATUS, MP_MSG(mpctx, MSGL_STATUS, "%s%s\r", line, erase_to_end_of_line);
"%s%s\r", line, erase_to_end_of_line);
} else { } else {
int pos = strlen(line); int pos = strlen(line);
int width = get_term_width() - pos; int width = get_term_width() - pos;
mp_msg(MSGT_STATUSLINE, MSGL_STATUS, "%s%*s\r", line, width, ""); MP_MSG(mpctx, MSGL_STATUS, "%s%*s\r", line, width, "");
} }
} }
@ -486,7 +485,7 @@ void update_osd_msg(struct MPContext *mpctx)
mpctx->terminal_osd_text = talloc_strdup(mpctx, msg->msg); mpctx->terminal_osd_text = talloc_strdup(mpctx, msg->msg);
// Multi-line message => clear what will be the second line // Multi-line message => clear what will be the second line
write_status_line(mpctx, ""); write_status_line(mpctx, "");
mp_msg(MSGT_CPLAYER, MSGL_STATUS, "%s%s\n", opts->term_osd_esc, MP_MSG(mpctx, MSGL_STATUS, "%s%s\n", opts->term_osd_esc,
mpctx->terminal_osd_text); mpctx->terminal_osd_text);
print_status(mpctx); print_status(mpctx);
} }
@ -513,6 +512,6 @@ void update_osd_msg(struct MPContext *mpctx)
// Clear the term osd line // Clear the term osd line
if (opts->term_osd && mpctx->terminal_osd_text[0]) { if (opts->term_osd && mpctx->terminal_osd_text[0]) {
mpctx->terminal_osd_text[0] = '\0'; mpctx->terminal_osd_text[0] = '\0';
mp_msg(MSGT_CPLAYER, MSGL_STATUS, "%s\n", opts->term_osd_esc); MP_MSG(mpctx, MSGL_STATUS, "%s\n", opts->term_osd_esc);
} }
} }

View File

@ -1017,7 +1017,7 @@ void run_playloop(struct MPContext *mpctx)
} }
} }
mp_msg(MSGT_AVSYNC, MSGL_DBG2, "*** ftime=%5.3f ***\n", frame_time); MP_TRACE(mpctx, "frametime=%5.3f\n", frame_time);
if (mpctx->d_video->vfilter && mpctx->d_video->vfilter->initialized < 0) if (mpctx->d_video->vfilter && mpctx->d_video->vfilter->initialized < 0)
{ {
MP_FATAL(mpctx, "\nFATAL: Could not initialize video filters " 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); mpctx->time_frame -= get_relative_time(mpctx);
if (full_audio_buffers && !mpctx->restart_playback) { if (full_audio_buffers && !mpctx->restart_playback) {
buffered_audio = ao_get_delay(mpctx->ao); buffered_audio = ao_get_delay(mpctx->ao);
mp_msg(MSGT_AVSYNC, MSGL_DBG2, "delay=%f\n", buffered_audio); MP_TRACE(mpctx, "audio delay=%f\n", buffered_audio);
if (opts->autosync) { if (opts->autosync) {
/* Smooth reported playback position from AO by averaging /* Smooth reported playback position from AO by averaging

View File

@ -78,7 +78,7 @@ static void screenshot_msg(screenshot_ctx *ctx, int status, const char *msg,
s = talloc_vasprintf(NULL, msg, ap); s = talloc_vasprintf(NULL, msg, ap);
va_end(ap); va_end(ap);
mp_msg(MSGT_CPLAYER, status == SMSG_ERR ? MSGL_ERR : MSGL_INFO, "%s\n", s); MP_MSG(ctx->mpctx, status == SMSG_ERR ? MSGL_ERR : MSGL_INFO, "%s\n", s);
if (ctx->osd) { if (ctx->osd) {
set_osd_msg(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); "%s", s);

View File

@ -107,8 +107,7 @@ void update_subtitles(struct MPContext *mpctx)
if (!demux_has_packet(sh_stream)) if (!demux_has_packet(sh_stream))
break; break;
if (subpts_s > curpts_s) { if (subpts_s > curpts_s) {
mp_msg(MSGT_CPLAYER, MSGL_DBG2, MP_DBG(mpctx, "Sub early: c_pts=%5.3f s_pts=%5.3f\n",
"Sub early: c_pts=%5.3f s_pts=%5.3f\n",
curpts_s, subpts_s); curpts_s, subpts_s);
// Libass handled subs can be fed to it in advance // Libass handled subs can be fed to it in advance
if (!sub_accept_packets_in_advance(dec_sub)) if (!sub_accept_packets_in_advance(dec_sub))
@ -118,9 +117,8 @@ void update_subtitles(struct MPContext *mpctx)
break; break;
} }
struct demux_packet *pkt = demux_read_packet(sh_stream); struct demux_packet *pkt = demux_read_packet(sh_stream);
mp_msg(MSGT_CPLAYER, MSGL_V, "Sub: c_pts=%5.3f s_pts=%5.3f " MP_DBG(mpctx, "Sub: c_pts=%5.3f s_pts=%5.3f duration=%5.3f len=%d\n",
"duration=%5.3f len=%d\n", curpts_s, pkt->pts, pkt->duration, curpts_s, pkt->pts, pkt->duration, pkt->len);
pkt->len);
sub_decode(dec_sub, pkt); sub_decode(dec_sub, pkt);
talloc_free(pkt); talloc_free(pkt);
} }

View File

@ -89,9 +89,9 @@ static void reconfig_video(struct MPContext *mpctx,
struct mp_image_params p = d_video->vfilter->output_params; struct mp_image_params p = d_video->vfilter->output_params;
const struct vo_driver *info = mpctx->video_out->driver; const struct vo_driver *info = mpctx->video_out->driver;
mp_msg(MSGT_CPLAYER, MSGL_INFO, "VO: [%s] %dx%d => %dx%d %s\n", MP_INFO(mpctx, "VO: [%s] %dx%d => %dx%d %s\n",
info->name, p.w, p.h, p.d_w, p.d_h, vo_format_name(p.imgfmt)); info->name, p.w, p.h, p.d_w, p.d_h, vo_format_name(p.imgfmt));
mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Description: %s\n", info->description); MP_VERBOSE(mpctx, "VO: Description: %s\n", info->description);
int r = vo_reconfig(mpctx->video_out, &p, 0); int r = vo_reconfig(mpctx->video_out, &p, 0);
if (r < 0) if (r < 0)