1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 18:12:22 +00:00
mpv/sub
wm4 488c0b4de5 sd_lavc: fix occasional problems with certain VOs when changing scaling
The OSD is passed to VOs via struct sub_bitmaps, which has a change_id
field. This field is incremented whenever there is a (potential) change
to the other struct contents. If not, the VO can rely on it not having
changed. This must include for example sub_bitmap.x and sub_bitmap.dw.
If these two fields (and y equivalents) change, change_id must change,
even if the subtitle bitmap data might still be the same.

sd_lavc.c stopped respecting this at some unknown point. It could
sometimes cause problems, though usually only with bad and old VOs which
somehow relied on this more than vo_gpu. (I've actually encountered this
before with sd_lavc subtitle scaling, as indicated by a nasty comment,
though probably didn't track this down, since said old VOs can die in a
fire.)

Fix this by maintaining the change_id explicitly. Unfortunately adds
even more code. Instead of comparing the result we could track property
changes, but I think this is better. The number of parts is always very
low with this subtitle decoder, so there's no actual performance issue
to worry about.

This could be triggered by scaling changes (video-zoom etc.), but
probably also changing bitmap subtitle position or scaling.
2020-05-09 18:02:57 +02:00
..
ass_mp.c video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
ass_mp.h command: extend osd-overlay command with bounds reporting 2020-03-06 18:20:11 +01:00
dec_sub.c video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
dec_sub.h video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
draw_bmp.c video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
draw_bmp.h video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
filter_regex.c sub: add an option to filter subtitles by regex 2020-02-16 02:07:24 +01:00
filter_sdh.c sub: make filter_sdh a "proper" filter, allow runtime changes 2020-02-16 02:07:24 +01:00
img_convert.c Replace uses of FFMIN/MAX with MPMIN/MAX 2019-10-31 11:24:20 +01:00
img_convert.h sub: move RGBA scaling to vo_vaapi 2016-07-03 19:32:43 +02:00
lavc_conv.c Remove remains of Libav compatibility 2020-02-16 15:14:55 +01:00
osd_font.otf osc: use custom symbols for window controls 2019-12-11 13:53:10 -08:00
osd_libass.c video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
osd_state.h osd: add change timestamp and screen size to struct sub_bitmap_list 2020-05-09 18:02:57 +02:00
osd.c osd: add change timestamp and screen size to struct sub_bitmap_list 2020-05-09 18:02:57 +02:00
osd.h osd: add change timestamp and screen size to struct sub_bitmap_list 2020-05-09 18:02:57 +02:00
sd_ass.c video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00
sd_lavc.c sd_lavc: fix occasional problems with certain VOs when changing scaling 2020-05-09 18:02:57 +02:00
sd.h video: make OSD/subtitle bitmaps refcounted (sort of) 2020-04-26 23:34:32 +02:00