summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-19 18:05:05 +0200
committerwm4 <wm4@nowhere>2012-09-07 16:06:36 +0200
commit330c90cbb8583ac41547bcd3d7259bc7b9e6a3b5 (patch)
treea2e58e54888fa6f64f5ee15adf52631f72255f48
parent83f68f725d80b23f76c9a8cd8dbb8349b33c9779 (diff)
downloadmpv-330c90cbb8583ac41547bcd3d7259bc7b9e6a3b5.tar.bz2
mpv-330c90cbb8583ac41547bcd3d7259bc7b9e6a3b5.tar.xz
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.
-rw-r--r--command.c46
-rw-r--r--input/input.c1
-rw-r--r--input/input.h1
-rw-r--r--mp_core.h2
-rw-r--r--mplayer.c4
5 files changed, 1 insertions, 53 deletions
diff --git a/command.c b/command.c
index 48606be43c..0e33ac3c64 100644
--- a/command.c
+++ b/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
diff --git a/input/input.c b/input/input.c
index 6bf45edf7e..34b8f019b8 100644
--- a/input/input.c
+++ b/input/input.c
@@ -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) } },
diff --git a/input/input.h b/input/input.h
index 910561fa9f..2460492df7 100644
--- a/input/input.h
+++ b/input/input.h
@@ -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,
diff --git a/mp_core.h b/mp_core.h
index 645c626022..47d7d6cbbb 100644
--- a/mp_core.h
+++ b/mp_core.h
@@ -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;
diff --git a/mplayer.c b/mplayer.c
index b5e7c8af54..27bca321d2 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -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;