1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 06:42:03 +00:00

player: cosmetics: move code around

Separate commit to reduce noise in the following one.
This commit is contained in:
wm4 2014-12-21 23:47:00 +01:00
parent d9f448da02
commit dc0b0cdeb0
2 changed files with 15 additions and 16 deletions

View File

@ -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);

View File

@ -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)
{