sub: remove osd_get_sub()

Trades one strange thing against another, but seems slightly less
strange.
This commit is contained in:
wm4 2014-10-31 23:59:10 +01:00
parent 75afef6463
commit 3f3a6b13bd
5 changed files with 7 additions and 13 deletions

View File

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

View File

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

View File

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

View File

@ -146,13 +146,6 @@ void osd_set_sub(struct osd_state *osd, int obj, struct osd_sub_state *substate)
pthread_mutex_unlock(&osd->lock);
}
void osd_get_sub(struct osd_state *osd, int obj, struct osd_sub_state *substate)
{
pthread_mutex_lock(&osd->lock);
*substate = osd->objs[obj]->sub_state;
pthread_mutex_unlock(&osd->lock);
}
bool osd_get_render_subs_in_filter(struct osd_state *osd)
{
pthread_mutex_lock(&osd->lock);

View File

@ -157,7 +157,6 @@ struct osd_sub_state {
bool render_bitmap_subs;
};
void osd_set_sub(struct osd_state *osd, int obj, struct osd_sub_state *substate);
void osd_get_sub(struct osd_state *osd, int obj, struct osd_sub_state *substate);
bool osd_get_render_subs_in_filter(struct osd_state *osd);
void osd_set_render_subs_in_filter(struct osd_state *osd, bool s);