mpv/demux
wm4 7b8d360288 demux_mkv: don't add too many subtitle packets during seeking
In insane files with a very huge number of subtitle events, and if the
--demuxer-mkv-subtitle-preroll option is given, seeking can still
overflow the packet queue. Normally, the subtitle_preroll variable
specifies the maximum number of packets that can be added. But once this
number is reached, the normal seeking behavior is enabled, which will
add all subtitle packets with the right timestamps to the packet queue.
At this point the next video keyframe can still be quite far away, with
enough subtitle packets on the way to overflow the packet queue.

Fix this by always setting an upper limit of subtitle packets read
during seeking. This should provide additional robustness even if the
preroll option is not used.

This means that even with normal seeking, at most 500 subtitle packets
are demuxed. Packets after that are discarded.

One slightly questionable aspect of this commit is that subtitle_preroll
is never reset in audio-only mode, but that is probably ok.
2013-09-20 21:20:33 +02:00
..
codec_tags.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
codec_tags.h core: redo how codecs are mapped, remove codecs.conf 2013-02-10 17:25:56 +01:00
demux.c demux: check whether stream is selected in demux_get_next_pts() 2013-08-22 21:19:40 +02:00
demux.h core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
demux_cue.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
demux_edl.c demux: remove useless author/comment fields 2013-07-12 22:16:27 +02:00
demux_lavf.c demux_lavf: workaround for broken libavformat subtitle seeking 2013-09-07 08:52:14 +02:00
demux_libass.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
demux_mf.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
demux_mkv.c demux_mkv: don't add too many subtitle packets during seeking 2013-09-20 21:20:33 +02:00
demux_mng.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
demux_packet.h demux: workaround for -demuxer mpegts -correct-pts 2013-05-21 22:07:13 +02:00
demux_raw.c demux_raw: read multiple frames per packet 2013-08-22 21:19:34 +02:00
demux_subreader.c demux_subreader: report what subtitle format has been found 2013-08-15 23:43:05 +02:00
ebml.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
ebml.h core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
matroska.h demux_mkv: support dirac in mkv 2013-05-21 22:07:12 +02:00
mf.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
mf.h demux_mf: allow displaying single image files, various cleanups 2012-11-16 21:21:16 +01:00
ms_hdr.h ms_hdr: remove unused definitions 2013-07-10 02:00:47 +02:00
stheader.h vdpau: split off decoder parts, use "new" libavcodec vdpau hwaccel API 2013-07-28 19:25:07 +02:00