summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-31 23:59:10 +0100
committerwm4 <wm4@nowhere>2014-11-01 00:02:01 +0100
commit3f3a6b13bd05f6b0c0a68d8857699368a1949cd6 (patch)
tree72f301a4e1cc60c6ad59cc6b5762f70cd15142b5 /player
parent75afef64638485aa982519cee21a7b55e2b90a28 (diff)
downloadmpv-3f3a6b13bd05f6b0c0a68d8857699368a1949cd6.tar.bz2
mpv-3f3a6b13bd05f6b0c0a68d8857699368a1949cd6.tar.xz
sub: remove osd_get_sub()
Trades one strange thing against another, but seems slightly less strange.
Diffstat (limited to 'player')
-rw-r--r--player/command.c2
-rw-r--r--player/core.h2
-rw-r--r--player/sub.c8
3 files changed, 7 insertions, 5 deletions
diff --git a/player/command.c b/player/command.c
index c69e058ae2..2cf91cfd68 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3989,7 +3989,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
if (!mpctx->num_sources)
return -1;
struct osd_sub_state state;
- osd_get_sub(mpctx->osd, OSDTYPE_SUB, &state);
+ get_osd_sub_state(mpctx, 0, &state);
if (state.dec_sub && mpctx->video_pts != MP_NOPTS_VALUE) {
double a[2];
a[0] = mpctx->video_pts - state.video_offset - opts->sub_delay;
diff --git a/player/core.h b/player/core.h
index 631e5c75e0..de21757cb1 100644
--- a/player/core.h
+++ b/player/core.h
@@ -475,6 +475,8 @@ void update_osd_msg(struct MPContext *mpctx);
void update_subtitles(struct MPContext *mpctx);
void init_sub_renderer(struct MPContext *mpctx);
void uninit_sub_renderer(struct MPContext *mpctx);
+void get_osd_sub_state(struct MPContext *mpctx, int order,
+ struct osd_sub_state *out_state);
// timeline/tl_matroska.c
void build_ordered_chapter_timeline(struct MPContext *mpctx);
diff --git a/player/sub.c b/player/sub.c
index 09da80f1ae..f694296c90 100644
--- a/player/sub.c
+++ b/player/sub.c
@@ -193,8 +193,8 @@ void reset_subtitle_state(struct MPContext *mpctx)
reset_subtitles(mpctx, 1);
}
-static void update_sub_state(struct MPContext *mpctx, int order,
- struct osd_sub_state *out_state)
+void get_osd_sub_state(struct MPContext *mpctx, int order,
+ struct osd_sub_state *out_state)
{
struct MPOpts *opts = mpctx->opts;
struct track *track = mpctx->current_track[order][STREAM_SUB];
@@ -242,7 +242,7 @@ static void update_subtitle(struct MPContext *mpctx, int order)
}
struct osd_sub_state state;
- update_sub_state(mpctx, order, &state);
+ get_osd_sub_state(mpctx, order, &state);
double refpts_s = mpctx->playback_pts - state.video_offset;
double curpts_s = refpts_s - opts->sub_delay;
@@ -339,5 +339,5 @@ void reinit_subs(struct MPContext *mpctx, int order)
struct dec_sub *dec_sub = mpctx->d_sub[order];
reinit_subdec(mpctx, track, dec_sub);
- update_sub_state(mpctx, order, NULL);
+ get_osd_sub_state(mpctx, order, NULL);
}