1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 01:52:19 +00:00
mpv/sub/osd_state.h
wm4 56616b0b01 osd: fix OSD getting stuck with --blend-subtitles=yes
If --blend-subtitles=yes is given, vo_opengl will call osd_draw()
multiple times, once for subtitles, and once for OSD. This meant that
the want_redraw flag was reset before the OSD was rendered, which in
turn meant that update_osd() was never called. It seems like removing
the per-OSD object want_redraw wasn't such a good idea. Fix it by
reintroducing such a flag for OSDTYPE_OSD only.

Also, the want_redraw flag is now unused, so kill it.

Another regression caused by commit 9c9cf125. Fixes #3535.
2016-09-16 17:17:32 +02:00

82 lines
1.4 KiB
C

#ifndef MP_OSD_STATE_H_
#define MP_OSD_STATE_H_
#include <pthread.h>
#include "osd.h"
enum mp_osdtype {
OSDTYPE_SUB,
OSDTYPE_SUB2, // IDs must be numerically successive
OSDTYPE_OSD,
OSDTYPE_EXTERNAL,
OSDTYPE_EXTERNAL2,
OSDTYPE_COUNT
};
struct ass_state {
struct mp_log *log;
struct ass_track *track;
struct ass_renderer *render;
struct ass_library *library;
};
struct osd_object {
int type; // OSDTYPE_*
bool is_sub;
// OSDTYPE_OSD
bool osd_changed;
char *text;
struct osd_progbar_state progbar_state;
// OSDTYPE_SUB/OSDTYPE_SUB2
struct dec_sub *sub;
// OSDTYPE_EXTERNAL
struct osd_external *externals;
int num_externals;
// OSDTYPE_EXTERNAL2
struct sub_bitmaps *external2;
// VO cache state
int vo_change_id;
struct mp_osd_res vo_res;
// Internally used by osd_libass.c
bool changed;
struct ass_state ass;
struct mp_ass_packer *ass_packer;
struct ass_image **ass_imgs;
};
struct osd_external {
void *id;
char *text;
int res_x, res_y;
struct ass_state ass;
};
struct osd_state {
pthread_mutex_t lock;
struct osd_object *objs[MAX_OSD_PARTS];
bool render_subs_in_filter;
bool want_redraw;
bool want_redraw_notification;
struct MPOpts *opts;
struct mpv_global *global;
struct mp_log *log;
struct mp_draw_sub_cache *draw_cache;
};
#endif