1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-06 15:11:58 +00:00
mpv/demux
wm4 1301a90761 demux: add a demuxer thread
This adds a thread to the demuxer which reads packets asynchronously.
It will do so until a configurable minimum packet queue size is
reached. (See options.rst additions.)

For now, the thread is disabled by default. There are some corner cases
that have to be fixed, such as fixing cache behavior with webradios.

Note that most interaction with the demuxer is still blocking, so if
e.g. network dies, the player will still freeze. But this change will
make it possible to remove most causes for freezing.

Most of the new code in demux.c actually consists of weird caches to
compensate for thread-safety issues (with the previously single-threaded
design), or to avoid blocking by having to wait on the demuxer thread.

Most of the changes in the player are due to the fact that we must not
access the source stream directly. the demuxer thread already accesses
it, and the stream stuff is not thread-safe.

For timeline stuff (like ordered chapters), we enable the thread for the
current segment only. We also clear its packet queue on seek, so that
the remaining (unconsumed) readahead buffer doesn't waste memory.

Keep in mind that insane subtitles (such as ASS typesetting muxed into
mkv files) will practically disable the readahead, because the total
queue size is considered when checking whether the minimum queue size
was reached.
2014-07-16 23:25:56 +02:00
..
codec_tags.c demux: add "BIKb" FourCC 2014-04-08 22:59:53 +02:00
codec_tags.h demux: remove gsh field from sh_audio/sh_video/sh_sub 2013-11-23 21:37:56 +01:00
demux_cue.c Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
demux_disc.c demux: add a demuxer thread 2014-07-16 23:25:56 +02:00
demux_edl.c
demux_lavf.c demux: add a demuxer thread 2014-07-16 23:25:56 +02:00
demux_libass.c demux_libass: change how external ASS subtitles are loaded 2014-03-15 22:17:51 +01:00
demux_mf.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00
demux_mkv.c demux: minor simplification 2014-07-06 19:02:21 +02:00
demux_playlist.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00
demux_raw.c demux: minor simplification to internal API 2014-07-05 17:07:15 +02:00
demux_subreader.c demux: minor simplification to internal API 2014-07-05 17:07:15 +02:00
demux_tv.c demux: minor simplification 2014-07-06 19:02:21 +02:00
demux.c demux: add a demuxer thread 2014-07-16 23:25:56 +02:00
demux.h demux: add a demuxer thread 2014-07-16 23:25:56 +02:00
ebml.c demux: minor cleanups 2014-07-01 21:53:23 +02:00
ebml.h demux: minor cleanups 2014-07-01 21:53:23 +02:00
matroska.h demux_mkv: add S_DVBSUB 2014-06-17 22:44:27 +02:00
mf.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
mf.h demux: mp_msg conversions 2013-12-21 21:43:16 +01:00
ms_hdr.h
packet.c Remove stream_pts stuff 2014-07-06 19:05:59 +02:00
packet.h Remove stream_pts stuff 2014-07-06 19:05:59 +02:00
stheader.h demux: add a demuxer thread 2014-07-16 23:25:56 +02:00