1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 06:14:32 +00:00
mpv/stream
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
..
resolve
ai_alsa1x.c Kill all tabs 2014-04-13 18:03:01 +02:00
ai_oss.c Kill all tabs 2014-04-13 18:03:01 +02:00
ai_sndio.c Kill all tabs 2014-04-13 18:03:01 +02:00
audio_in.c Kill all tabs 2014-04-13 18:03:01 +02:00
audio_in.h
cache_file.c cache_file: fix operation if stream size is unknown 2014-07-12 19:18:21 +02:00
cache.c demux: add a demuxer thread 2014-07-16 23:25:56 +02:00
cookies.c Kill all tabs 2014-04-13 18:03:01 +02:00
cookies.h
discnav.h player: rename dvdnav to discnav 2014-03-30 11:42:49 +09:00
dvb_tune.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
dvb_tune.h
dvbin.h stream_dvb: remove global option variables 2014-06-11 00:35:03 +02:00
frequencies.c stream_pvr: remove global option variables 2014-06-11 00:34:42 +02:00
frequencies.h stream_pvr: remove global option variables 2014-06-11 00:34:42 +02:00
rar.c Revert "build: avoid defining _GNU_SOURCE" 2014-07-10 09:25:37 +02:00
rar.h
stream_avdevice.c Add more const 2014-06-11 00:39:14 +02:00
stream_bluray.c Revert "Remove DVD and Bluray support" 2014-07-15 01:49:02 +02:00
stream_cdda.c build: deal with endian mess 2014-07-10 00:58:56 +02:00
stream_dvb.c Audit and replace all ctype.h uses 2014-07-01 23:11:08 +02:00
stream_dvd_common.c Add more const 2014-06-11 00:39:14 +02:00
stream_dvd_common.h stream_dvd: minor cleanups 2014-06-11 00:39:13 +02:00
stream_dvd.c Revert "Remove DVD and Bluray support" 2014-07-15 01:49:02 +02:00
stream_dvdnav.c Revert "Remove DVD and Bluray support" 2014-07-15 01:49:02 +02:00
stream_edl.c Add more const 2014-06-11 00:39:14 +02:00
stream_file.c Add more const 2014-06-11 00:39:14 +02:00
stream_lavf.c demux, stream: change metadata notification 2014-07-05 17:07:14 +02:00
stream_memory.c Add more const 2014-06-11 00:39:14 +02:00
stream_mf.c Add more const 2014-06-11 00:39:14 +02:00
stream_null.c Add more const 2014-06-11 00:39:14 +02:00
stream_pvr.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00
stream_rar.c Add more const 2014-06-11 00:39:14 +02:00
stream_smb.c Add more const 2014-06-11 00:39:14 +02:00
stream_tv.c Add more const 2014-06-11 00:39:14 +02:00
stream.c Revert "Remove DVD and Bluray support" 2014-07-15 01:49:02 +02:00
stream.h Revert "Remove DVD and Bluray support" 2014-07-15 01:49:02 +02:00
tv.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00
tv.h tv: move demuxer parts to separate file 2014-07-05 17:07:15 +02:00
tvi_def.h Kill all tabs 2014-04-13 18:03:01 +02:00
tvi_dummy.c tv: remove printing of useless comment information 2014-06-11 00:34:42 +02:00
tvi_v4l2.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00