mpv/sub
wm4 05b2cd08dc sub: make preloading more robust
Subtitles can be preloaded, which means they're fully read and copied
into ASS_Track. This in turn is mainly for the sake of being able to do
subtitle seeking (when it comes down to it, subtitle seeking is the
cause for most trouble here).

Commit a714f8e92 broke preloaded subtitles which have events with
unknown duration, such as some MicroDVD samples. The event list gets
cleared on every seek, so the property of being preloaded obviously gets
lost.

Fix this by moving most of the preloading logic to dec_sub.c. If the
subtitle list gets cleared, they are not considered preloaded anymore,
and the logic for demuxed subtitles is used.

As another minor thing, preloadeding subtitles did neither disable the
demux stream, nor did it discard packets. Thus you could get queue
overflows in theory (harmless, but annoying). Fix this by explicitly
discarding packets in preloaded mode.

In summary, now the only difference between preloaded and normal
demuxing are:
1. a seek is issued, and all packets are read on start
2. during playback, discard the packets instead of feeding them to the
   subtitle decoder

This is still petty annoying. It would be nice if maintaining the
subtitle index (and maybe a subtitle packet cache for instant subtitle
presentation when seeking back) could be maintained in the demuxer
instead. Half of all file formats with interleaved subtitles have
this anyway (mp4, mkv muxed with newer mkvmerge).
2016-03-06 15:17:59 +01:00
..
ass_mp.c ass_mp: add mp_ass_flush_old_events() 2016-01-18 12:12:34 -08:00
ass_mp.h ass_mp: add mp_ass_flush_old_events() 2016-01-18 12:12:34 -08:00
dec_sub.c sub: make preloading more robust 2016-03-06 15:17:59 +01:00
dec_sub.h sub: make preloading more robust 2016-03-06 15:17:59 +01:00
draw_bmp.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
draw_bmp.h
img_convert.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
img_convert.h
lavc_conv.c lavc_conv: fix Libav srt subtitles 2016-02-29 18:20:27 +01:00
osd.c osd: make osd-width/height properties watchable 2016-01-15 22:54:08 +01:00
osd.h osd: use the same ASS_Renderer for OSD text and progbar 2015-11-28 19:24:31 +01:00
osd_dummy.c mpv_talloc.h: rename from talloc.h 2016-01-11 21:05:55 +01:00
osd_font.otf
osd_libass.c Relicense some non-MPlayer source files to LGPL 2.1 or later 2016-01-19 18:36:06 +01:00
osd_state.h osd: use the same ASS_Renderer for OSD text and progbar 2015-11-28 19:24:31 +01:00
sd.h sub: make preloading more robust 2016-03-06 15:17:59 +01:00
sd_ass.c sub: make preloading more robust 2016-03-06 15:17:59 +01:00
sd_lavc.c sub: implement "sub-seek 0" 2016-02-04 22:48:13 +01:00