mpv/sub
wm4 4a8647b6b8 sub: don't potentially discard too many subtitles on seek
The accepts_packet packet callback is supposed to deal with subtitle
decoders which have only a small queue of current subtitle events (i.e.
sd_lavc.c), in case feeding it too many packets would discard events
that are still needed.

Normally, the number of subtitles that need to be preserved is estimated
by the rendering pts (get_bitmaps() argument). Rendering lags behind
decoding, so normally the rendering pts is smaller than the next video
frame pts, and we simply discard all subtitle events until the rendering
pts.

This breaks down in some annoying corner cases. One of them is seeking
backwards: the VO will still try to render the old PTS during seeks,
which passes a high PTS to the subtitle renderer, which in turn would
discard more subtitles than it should. There is a similar issue with
forward seeks. Add hacks to deal with those issues.

There should be a better way to deal with the essentially unknown
"rendering position", which is made worse by screenshots or rendering
with vf_sub. At the very least, we could handle seeks better, and e.g.
either force the VO not to re-render subs after seeks (ugly), or
introduce seek sequence numbers to distinguish attempts to render
earlier subtitles when a seek is done.
2016-08-14 20:27:37 +02:00
..
ass_mp.c sub: change how libass output is converted to RGBA in some cases 2016-07-03 19:32:31 +02:00
ass_mp.h sub: pack libass bitmaps directly in sd_ass.c and osd_libass.c 2016-06-30 21:38:50 +02:00
dec_sub.c sub: don't potentially discard too many subtitles on seek 2016-08-14 20:27:37 +02:00
dec_sub.h sub: pass preferred OSD format to subtitle renderers 2016-07-03 19:31:56 +02:00
draw_bmp.c mp_image: split colorimetry metadata into its own struct 2016-07-03 19:42:52 +02:00
draw_bmp.h csputils: get rid of mp_csp_details 2015-01-06 16:50:58 +01:00
img_convert.c sub: move RGBA scaling to vo_vaapi 2016-07-03 19:32:43 +02:00
img_convert.h sub: move RGBA scaling to vo_vaapi 2016-07-03 19:32:43 +02:00
lavc_conv.c sub: interpret "text" subtitles as srt 2016-04-06 12:36:13 +02:00
osd.c sub: remove unused sub_bitmaps.scaled field 2016-07-03 19:32:43 +02:00
osd.h sub: remove unused sub_bitmaps.scaled field 2016-07-03 19:32:43 +02:00
osd_dummy.c sub: pass preferred OSD format to subtitle renderers 2016-07-03 19:31:56 +02:00
osd_font.otf osd+osc: Add left-arrow to osd-font 2014-08-21 18:45:41 +02:00
osd_libass.c sub: pass preferred OSD format to subtitle renderers 2016-07-03 19:31:56 +02:00
osd_state.h sub: change how libass output is converted to RGBA in some cases 2016-07-03 19:32:31 +02:00
sd.h sub: don't potentially discard too many subtitles on seek 2016-08-14 20:27:37 +02:00
sd_ass.c mp_image: split colorimetry metadata into its own struct 2016-07-03 19:42:52 +02:00
sd_lavc.c sub: don't potentially discard too many subtitles on seek 2016-08-14 20:27:37 +02:00