Unified · Split
| @@ -363,6 +363,7 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj, · 362 unmodified lines | |||
| 363 | float *o_border) | 363 | float *o_border) |
| 364 | { | 364 | { |
| 365 | struct mp_osd_render_opts *opts = osd->opts; | 365 | struct mp_osd_render_opts *opts = osd->opts; |
| 366 | struct osd_bar_style_opts *bar_opts = opts->osd_bar_style; | ||
| 366 | 367 | ||
| 367 | create_ass_track(osd, obj, &obj->ass); | 368 | create_ass_track(osd, obj, &obj->ass); |
| 368 | ASS_Track *track = obj->ass.track; | 369 | ASS_Track *track = obj->ass.track; |
| @@ -380,10 +381,10 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj, · 11 unmodified lines | |||
| 380 | // and each bar ass event gets its own opaque box - breaking the bar. | 381 | // and each bar ass event gets its own opaque box - breaking the bar. |
| 381 | style->BorderStyle = 1; // outline | 382 | style->BorderStyle = 1; // outline |
| 382 | 383 | ||
| 383 | *o_w = track->PlayResX * (opts->osd_bar_style->w / 100.0); | 384 | *o_w = track->PlayResX * (bar_opts->w / 100.0); |
| 384 | *o_h = track->PlayResY * (opts->osd_bar_style->h / 100.0); | 385 | *o_h = track->PlayResY * (bar_opts->h / 100.0); |
| 385 | 386 | ||
| 386 | style->Outline = opts->osd_bar_style->outline_size; | 387 | style->Outline = bar_opts->outline_size; |
| 387 | // Rendering with shadow is broken (because there's more than one shape) | 388 | // Rendering with shadow is broken (because there's more than one shape) |
| 388 | style->Shadow = 0; | 389 | style->Shadow = 0; |
| 389 | style->Blur = 0; | 390 | style->Blur = 0; |
| @@ -392,8 +393,8 @@ static void get_osd_bar_box(struct osd_state *osd, struct osd_object *obj, · 2 unmodified lines | |||
| 392 | 393 | ||
| 393 | *o_border = style->Outline; | 394 | *o_border = style->Outline; |
| 394 | 395 | ||
| 395 | *o_x = get_align(opts->osd_bar_style->align_x, track->PlayResX, *o_w, *o_border); | 396 | *o_x = get_align(bar_opts->align_x, track->PlayResX, *o_w, *o_border); |
| 396 | *o_y = get_align(opts->osd_bar_style->align_y, track->PlayResY, *o_h, *o_border); | 397 | *o_y = get_align(bar_opts->align_y, track->PlayResY, *o_h, *o_border); |
| 397 | } | 398 | } |
| 398 | 399 | ||
| 399 | static void update_progbar(struct osd_state *osd, struct osd_object *obj) | 400 | static void update_progbar(struct osd_state *osd, struct osd_object *obj) |
| @@ -469,14 +470,15 @@ static void update_progbar(struct osd_state *osd, struct osd_object *obj) · 69 unmodified lines | |||
| 469 | // the "hole" | 470 | // the "hole" |
| 470 | ass_draw_rect_ccw(d, 0, 0, width, height); | 471 | ass_draw_rect_ccw(d, 0, 0, width, height); |
| 471 | 472 | ||
| 473 | struct osd_bar_style_opts *bar_opts = osd->opts->osd_bar_style; | ||
| 472 | // chapter marks | 474 | // chapter marks |
| 473 | if (osd->opts->osd_bar_style->marker_style) { | 475 | if (bar_opts->marker_style) { |
| 474 | for (int n = 0; n < obj->progbar_state.num_stops; n++) { | 476 | for (int n = 0; n < obj->progbar_state.num_stops; n++) { |
| 475 | float s = obj->progbar_state.stops[n] * width; | 477 | float s = obj->progbar_state.stops[n] * width; |
| 476 | float size = MPMAX(border * osd->opts->osd_bar_style->marker_scale, | 478 | float size = MPMAX(border * bar_opts->marker_scale, |
| 477 | osd->opts->osd_bar_style->marker_min_size); | 479 | bar_opts->marker_min_size); |
| 478 | 480 | ||
| 479 | if (osd->opts->osd_bar_style->marker_style == 2 && | 481 | if (bar_opts->marker_style == 2 && |
| 480 | s > size / 2 && s < width - size / 2) | 482 | s > size / 2 && s < width - size / 2) |
| 481 | { // line | 483 | { // line |
| 482 | ass_draw_rect_cw(d, s - size / 2, 0, s + size / 2, height); | 484 | ass_draw_rect_cw(d, s - size / 2, 0, s + size / 2, height); |