summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-09-29 11:03:53 +0200
committerwm4 <wm4@nowhere>2012-10-16 07:26:31 +0200
commit252ddcc014b7672a4434823fc6275be1b039bd79 (patch)
tree5bd84ef90f84a5b9c5a60d99eae2cedb3321207d
parente62b3a175016eaf93ef5ead7ea3891bc85327a55 (diff)
downloadmpv-252ddcc014b7672a4434823fc6275be1b039bd79.tar.bz2
mpv-252ddcc014b7672a4434823fc6275be1b039bd79.tar.xz
sub: cleanup: remove vo_osd_probar_type/value global variables
-rw-r--r--libvo/vo_caca.c6
-rw-r--r--mplayer.c6
-rw-r--r--sub/osd_libass.c12
-rw-r--r--sub/sub.c5
-rw-r--r--sub/sub.h4
5 files changed, 15 insertions, 18 deletions
diff --git a/libvo/vo_caca.c b/libvo/vo_caca.c
index 2dfaa2a90f..c2bc53138d 100644
--- a/libvo/vo_caca.c
+++ b/libvo/vo_caca.c
@@ -325,9 +325,9 @@ static void uninit(struct vo *vo)
static void draw_osd(struct vo *vo, struct osd_state *osd)
{
- if (vo_osd_progbar_type != -1)
- osdpercent(MESSAGE_DURATION, 0, 255, vo_osd_progbar_value,
- sub_osd_names[vo_osd_progbar_type], "");
+ if (osd->progbar_type != -1)
+ osdpercent(MESSAGE_DURATION, 0, 255, osd->progbar_value,
+ sub_osd_names[osd->progbar_type], "");
}
static int preinit(struct vo *vo, const char *arg)
diff --git a/mplayer.c b/mplayer.c
index 3d4e61c9e2..6fe8c649c4 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -1430,7 +1430,7 @@ static mp_osd_msg_t *get_osd_msg(struct MPContext *mpctx)
// the difference is greater assume it's wrapped around from below 0
if (mpctx->osd_visible - now > 36000000) {
mpctx->osd_visible = 0;
- vo_osd_progbar_type = -1; // disable
+ mpctx->osd->progbar_type = -1; // disable
vo_osd_changed(OSDTYPE_PROGBAR);
mpctx->osd_function = mpctx->paused ? OSD_PAUSE : OSD_PLAY;
}
@@ -1490,8 +1490,8 @@ void set_osd_bar(struct MPContext *mpctx, int type, const char *name,
if (mpctx->sh_video && opts->term_osd != 1) {
mpctx->osd_visible = (GetTimerMS() + 1000) | 1;
- vo_osd_progbar_type = type;
- vo_osd_progbar_value = 256 * (val - min) / (max - min);
+ mpctx->osd->progbar_type = type;
+ mpctx->osd->progbar_value = 256 * (val - min) / (max - min);
vo_osd_changed(OSDTYPE_PROGBAR);
return;
}
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 6c325642c5..dee60c7df7 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -176,7 +176,7 @@ static void update_osd(struct osd_state *osd, struct osd_object *obj)
static void update_progbar(struct osd_state *osd, struct osd_object *obj)
{
- if (vo_osd_progbar_type < 0) {
+ if (osd->progbar_type < 0) {
clear_obj(obj);
return;
}
@@ -199,16 +199,16 @@ static void update_progbar(struct osd_state *osd, struct osd_object *obj)
style->FontSize = 22.0;
style->Outline = style->FontSize / 16 * scale;
- int active = (vo_osd_progbar_value * OSDBAR_ELEMS + 255) / 256;
+ int active = (osd->progbar_value * OSDBAR_ELEMS + 255) / 256;
active = FFMIN(OSDBAR_ELEMS, FFMAX(active, 0));
char *text = talloc_strdup(NULL, "{\\q2}");
- if (vo_osd_progbar_type >= 32) {
- text = append_utf8_buffer(text, vo_osd_progbar_type);
- } else if (vo_osd_progbar_type > 0) {
+ if (osd->progbar_type >= 32) {
+ text = append_utf8_buffer(text, osd->progbar_type);
+ } else if (osd->progbar_type > 0) {
text = talloc_strdup_append_buffer(text, ASS_USE_OSD_FONT);
- text = append_utf8_buffer(text, OSD_CODEPOINTS + vo_osd_progbar_type);
+ text = append_utf8_buffer(text, OSD_CODEPOINTS + osd->progbar_type);
text = talloc_strdup_append_buffer(text, "{\\r}");
}
diff --git a/sub/sub.c b/sub/sub.c
index 182215310f..8e80730b9a 100644
--- a/sub/sub.c
+++ b/sub/sub.c
@@ -66,8 +66,6 @@ int sub_bg_color=0; /* subtitles background color */
int sub_bg_alpha=0;
int sub_justify=0;
-int vo_osd_progbar_type=-1;
-int vo_osd_progbar_value=100; // 0..256
subtitle* vo_sub=NULL;
char *subtitle_font_encoding = NULL;
float text_font_scale_factor = 3.5;
@@ -113,6 +111,8 @@ struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib)
*osd = (struct osd_state) {
.opts = opts,
.ass_library = asslib,
+ .osd_text = talloc_strdup(osd, ""),
+ .progbar_type = -1,
};
for (int n = 0; n < MAX_OSD_PARTS; n++) {
struct osd_object *obj = talloc_struct(osd, struct osd_object, {
@@ -122,7 +122,6 @@ struct osd_state *osd_create(struct MPOpts *opts, struct ass_library *asslib)
obj->cache[i] = talloc_steal(obj, osd_conv_cache_new());
osd->objs[n] = obj;
}
- osd->osd_text = talloc_strdup(osd, "");
osd_init_backend(osd);
global_osd = osd;
return osd;
diff --git a/sub/sub.h b/sub/sub.h
index ceecce4017..5e1809bee1 100644
--- a/sub/sub.h
+++ b/sub/sub.h
@@ -73,6 +73,7 @@ struct osd_state {
int w, h;
char *osd_text; // OSDTYPE_OSD
+ int progbar_type, progbar_value; // OSDTYPE_PROGBAR
// temporary for sub decoders
int bitmap_id;
@@ -87,9 +88,6 @@ struct osd_state {
extern subtitle* vo_sub;
-extern int vo_osd_progbar_type;
-extern int vo_osd_progbar_value; // 0..255
-
extern void* vo_spudec;
extern void* vo_vobsub;