mirror of https://github.com/mpv-player/mpv
command: remove sub_log command
Not very useful, and introduced special cases. Just get rid of it, can be reintroduced if in a better way if someone misses this feature.
This commit is contained in:
parent
83f68f725d
commit
330c90cbb8
46
command.c
46
command.c
|
@ -185,48 +185,6 @@ static void update_global_sub_size(MPContext *mpctx)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Log the currently displayed subtitle to a file
|
||||
*
|
||||
* Logs the current or last displayed subtitle together with filename
|
||||
* and time information to ~/.mplayer/subtitle_log
|
||||
*
|
||||
* Intended purpose is to allow convenient marking of bogus subtitles
|
||||
* which need to be fixed while watching the movie.
|
||||
*/
|
||||
|
||||
static void log_sub(struct MPContext *mpctx)
|
||||
{
|
||||
char *fname;
|
||||
FILE *f;
|
||||
int i;
|
||||
struct subtitle *vo_sub_last = mpctx->vo_sub_last;
|
||||
|
||||
if (mpctx->subdata == NULL || vo_sub_last == NULL)
|
||||
return;
|
||||
fname = get_path("subtitle_log");
|
||||
f = fopen(fname, "a");
|
||||
if (!f)
|
||||
return;
|
||||
fprintf(f, "----------------------------------------------------------\n");
|
||||
if (mpctx->subdata->sub_uses_time) {
|
||||
fprintf(f,
|
||||
"N: %s S: %02ld:%02ld:%02ld.%02ld E: %02ld:%02ld:%02ld.%02ld\n",
|
||||
mpctx->filename, vo_sub_last->start / 360000,
|
||||
(vo_sub_last->start / 6000) % 60,
|
||||
(vo_sub_last->start / 100) % 60, vo_sub_last->start % 100,
|
||||
vo_sub_last->end / 360000, (vo_sub_last->end / 6000) % 60,
|
||||
(vo_sub_last->end / 100) % 60, vo_sub_last->end % 100);
|
||||
} else {
|
||||
fprintf(f, "N: %s S: %ld E: %ld\n", mpctx->filename,
|
||||
vo_sub_last->start, vo_sub_last->end);
|
||||
}
|
||||
for (i = 0; i < vo_sub_last->lines; i++)
|
||||
fprintf(f, "%s\n", vo_sub_last->text[i]);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
static int mp_property_generic_option(struct m_option *prop, int action,
|
||||
void *arg, MPContext *mpctx)
|
||||
{
|
||||
|
@ -2881,10 +2839,6 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
|||
}
|
||||
break;
|
||||
|
||||
case MP_CMD_SUB_LOG:
|
||||
log_sub(mpctx);
|
||||
break;
|
||||
|
||||
case MP_CMD_OSD: {
|
||||
int v = cmd->args[0].v.i;
|
||||
int max = (opts->term_osd
|
||||
|
|
|
@ -139,7 +139,6 @@ static const mp_cmd_t mp_cmds[] = {
|
|||
{ MP_CMD_SUB_VOB, "sub_vob", { OARG_INT(-2) } },
|
||||
{ MP_CMD_SUB_DEMUX, "sub_demux", { OARG_INT(-2) } },
|
||||
{ MP_CMD_SUB_FILE, "sub_file", { OARG_INT(-2) } },
|
||||
{ MP_CMD_SUB_LOG, "sub_log", },
|
||||
{ MP_CMD_SUB_SCALE, "sub_scale", { ARG_FLOAT, OARG_INT(0) } },
|
||||
#ifdef CONFIG_ASS
|
||||
{ MP_CMD_ASS_USE_MARGINS, "ass_use_margins", { OARG_INT(-1) } },
|
||||
|
|
|
@ -81,7 +81,6 @@ enum mp_command_type {
|
|||
MP_CMD_SPEED_MULT,
|
||||
MP_CMD_SPEED_SET,
|
||||
MP_CMD_RUN,
|
||||
MP_CMD_SUB_LOG,
|
||||
MP_CMD_SWITCH_AUDIO,
|
||||
MP_CMD_GET_TIME_POS,
|
||||
MP_CMD_SUB_LOAD,
|
||||
|
|
|
@ -84,8 +84,6 @@ typedef struct MPContext {
|
|||
struct mp_osd_msg *osd_msg_stack;
|
||||
char *terminal_osd_text;
|
||||
struct sub_data *subdata; // current sub_data style subtitles if any
|
||||
// last sub_data style sub line if any, used by log_sub() only
|
||||
struct subtitle *vo_sub_last;
|
||||
|
||||
bool add_osd_seek_info;
|
||||
unsigned int osd_visible;
|
||||
|
|
|
@ -1621,8 +1621,6 @@ void update_subtitles(struct MPContext *mpctx, double refpts_tl, bool reset)
|
|||
sub_fps = sh_video ? sh_video->fps : 25;
|
||||
find_sub(mpctx, mpctx->subdata, curpts_s *
|
||||
(mpctx->subdata->sub_uses_time ? 100. : sub_fps));
|
||||
if (vo_sub)
|
||||
mpctx->vo_sub_last = vo_sub;
|
||||
}
|
||||
|
||||
// DVD sub:
|
||||
|
@ -3709,7 +3707,7 @@ terminate_playback: // don't jump here after ao/vo/getch initialization!
|
|||
}
|
||||
mpctx->set_of_sub_size = 0;
|
||||
}
|
||||
mpctx->vo_sub_last = vo_sub = NULL;
|
||||
vo_sub = NULL;
|
||||
mpctx->subdata = NULL;
|
||||
#ifdef CONFIG_ASS
|
||||
mpctx->osd->ass_track = NULL;
|
||||
|
|
Loading…
Reference in New Issue