diff options
author | Dudemanguy <random342@airmail.cc> | 2024-02-08 11:24:22 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-02-08 11:43:24 -0600 |
commit | df720b521816da07d6f094b82eacd9de92cc2954 (patch) | |
tree | e2937485b45588cbcfefc177dba281743e8ba785 /sub/sd_lavc.c | |
parent | 36153d1a4a6e194e373de64cc2bced5018daafd9 (diff) | |
download | mpv-df720b521816da07d6f094b82eacd9de92cc2954.tar.bz2 mpv-df720b521816da07d6f094b82eacd9de92cc2954.tar.xz |
sd_lavc: support secondary subs properly
Before 3250f6e4473b6c0ba1be03af3c80f3141b485721, secondary subtitles
didn't work properly with sd_lavc at all. They would render but be in
the same position as the primary subtitles. sd_ass used SD_CTRL_SET_TOP
to specifically place secondary subtitles in a different spot, but it
was unused by sd_lavc. With that above mentioned commit, it became
possible to distinguish between the position of primary and secondary
subtitles via mpv's option system. sd_lavc was missed however because at
the time we simply didn't realize this could work and was actually
simple. With some subsequent refactoring that happened later, the fix is
to just use the correct sd->order when accessing the shared subtitle
options instead of hard coding 0. Fixes #13440.
Diffstat (limited to 'sub/sd_lavc.c')
-rw-r--r-- | sub/sd_lavc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index b6e0ffea3e..988f6e088d 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -454,8 +454,8 @@ static struct sub_bitmaps *get_bitmaps(struct sd *sd, struct mp_osd_res d, h = MPMAX(priv->video_params.h, current->src_h); } - if (shared_opts->sub_pos[0] != 100.0f && shared_opts->ass_style_override[0]) { - float offset = (100.0f - shared_opts->sub_pos[0]) / 100.0f * h; + if (shared_opts->sub_pos[sd->order] != 100.0f && shared_opts->ass_style_override[sd->order]) { + float offset = (100.0f - shared_opts->sub_pos[sd->order]) / 100.0f * h; for (int n = 0; n < res->num_parts; n++) { struct sub_bitmap *sub = &res->parts[n]; @@ -473,7 +473,7 @@ static struct sub_bitmaps *get_bitmaps(struct sd *sd, struct mp_osd_res d, osd_rescale_bitmaps(res, w, h, d, video_par); - if (opts->sub_scale != 1.0 && shared_opts->ass_style_override[0]) { + if (opts->sub_scale != 1.0 && shared_opts->ass_style_override[sd->order]) { for (int n = 0; n < res->num_parts; n++) { struct sub_bitmap *sub = &res->parts[n]; |