mpv/sub
Guido Cella 0f2370476b sub: fix sub-seek and sub-step -1 with unknown duration subs
f9cefbfec4 made it so mp_ass_flush_old_events() is continously called on
subtitles with unknown duration, without explaining why, breaking
sub-seek/step -1 with a VO (the issue does not occur when showing
subtitles in the terminal because get_bitmaps() is not called). I don't
experience any issue after removing the call, so delete it to fix these
commands.

After removing that, you can sub-seek -1 once after regular playback,
but not after seeking and thus not multiple times in a row. This is
caused by a714f8e928 which fixed subtitles with unknown duration being
duplicated when seeking with a VO (it does not happen in the terminal)
by clearing old lines on seeks, which broke sub-seek -1 and sub-step -1
in a second way after any seek. The proper fix is to remove the line
ctx->num_seen_packets = 0 for subtitles with unknown duration instead,
which lets decode() return early when a line has already been shown.

Having removed these 2 lines, I also removed sd->preload_ok = false, and
thus the whole conditional, since according to sub/sd.h preload_ok only
needs to be set to false when old subtitles are discarded, and they are
no longer discarded,

The bug can be reproduced with
mpv --sub-file=<(curl 'https://music.xianqiao.wang/neteaseapiv2/lyric?id=1399616170' | jq -r .lrc.lyric) 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
2024-01-20 16:08:07 +00:00
..
ass_mp.c sub: add --sub-fonts-dir and --osd-fonts-dir options 2023-03-01 02:09:46 +00:00
ass_mp.h sub/ass_mp: filters/f_lavfi: forward declare mp_log 2023-09-21 14:40:11 +00:00
dec_sub.c options: add --secondary-sub-ass-override 2023-12-18 14:58:34 +00:00
dec_sub.h options: add --secondary-sub-pos 2023-12-13 21:18:57 +00:00
draw_bmp.c draw_bmp: fix overflowing coordinates in mark_rcs 2023-07-30 20:06:20 +02:00
draw_bmp.h test: integrate unittests with meson 2023-03-02 15:45:27 +00:00
filter_jsre.c sub: jsre filter: abort init early on empty filter list 2022-06-09 14:38:24 +03:00
filter_regex.c sub: sub-filter-regex and jsre: support ass-to-plaintext 2021-08-05 21:32:22 +03:00
filter_sdh.c filter_sdh: optimize get_char_bytes 2024-01-15 16:05:17 +00:00
img_convert.c various: replace some OOM handling 2023-11-24 10:04:55 +01:00
img_convert.h sub: move RGBA scaling to vo_vaapi 2016-07-03 19:32:43 +02:00
lavc_conv.c sub/lavc_conv: properly fill avctx with codecpar values at init 2023-03-14 23:59:47 +02:00
meson.build build: remove outdated generated directory 2023-07-31 19:00:06 +00:00
osd.c ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
osd.h sub: add --sub-fonts-dir and --osd-fonts-dir options 2023-03-01 02:09:46 +00:00
osd_font.otf osc: use custom symbols for window controls 2019-12-11 13:53:10 -08:00
osd_libass.c options: add --osd-bar-border-size 2023-11-27 15:02:28 +00:00
osd_state.h ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00
sd.h options: add --secondary-sub-ass-override 2023-12-18 14:58:34 +00:00
sd_ass.c sub: fix sub-seek and sub-step -1 with unknown duration subs 2024-01-20 16:08:07 +00:00
sd_lavc.c options: add --secondary-sub-ass-override 2023-12-18 14:58:34 +00:00