From dc0b0cdeb094d132009c80fda5efa6dae1af5540 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 21 Dec 2014 23:47:00 +0100 Subject: [PATCH] player: cosmetics: move code around Separate commit to reduce noise in the following one. --- player/core.h | 1 - player/sub.c | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/player/core.h b/player/core.h index d6360c5135..c03fedef33 100644 --- a/player/core.h +++ b/player/core.h @@ -468,7 +468,6 @@ void mp_load_scripts(struct MPContext *mpctx); // sub.c void reset_subtitle_state(struct MPContext *mpctx); -void reset_subtitles(struct MPContext *mpctx, int order); void uninit_stream_sub_decoders(struct demuxer *demuxer); void reinit_subs(struct MPContext *mpctx, int order); void uninit_sub(struct MPContext *mpctx, int order); diff --git a/player/sub.c b/player/sub.c index a409647e35..a55cc40527 100644 --- a/player/sub.c +++ b/player/sub.c @@ -132,6 +132,21 @@ void mp_ass_configure_fonts(struct ass_renderer *a, struct MPOpts *b, #endif +static void reset_subtitles(struct MPContext *mpctx, int order) +{ + int obj = order ? OSDTYPE_SUB2 : OSDTYPE_SUB; + if (mpctx->d_sub[order]) + sub_reset(mpctx->d_sub[order]); + set_osd_subtitle(mpctx, NULL); + osd_set_text(mpctx->osd, obj, NULL); +} + +void reset_subtitle_state(struct MPContext *mpctx) +{ + reset_subtitles(mpctx, 0); + reset_subtitles(mpctx, 1); +} + void uninit_stream_sub_decoders(struct demuxer *demuxer) { for (int i = 0; i < demuxer->num_streams; i++) { @@ -178,21 +193,6 @@ static bool is_interleaved(struct MPContext *mpctx, struct track *track) return track->demuxer == mpctx->demuxer; } -void reset_subtitles(struct MPContext *mpctx, int order) -{ - int obj = order ? OSDTYPE_SUB2 : OSDTYPE_SUB; - if (mpctx->d_sub[order]) - sub_reset(mpctx->d_sub[order]); - set_osd_subtitle(mpctx, NULL); - osd_set_text(mpctx->osd, obj, NULL); -} - -void reset_subtitle_state(struct MPContext *mpctx) -{ - reset_subtitles(mpctx, 0); - reset_subtitles(mpctx, 1); -} - void get_osd_sub_state(struct MPContext *mpctx, int order, struct osd_sub_state *out_state) {