summaryrefslogtreecommitdiffstats
path: root/demux/stheader.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-16 22:40:21 +0200
committerwm4 <wm4@nowhere>2014-07-16 23:25:56 +0200
commit1301a907617459237fb0071b4640ad53d0ae491f (patch)
treea3eb637ac01f1f11c53922ac9589e2e826869f2c /demux/stheader.h
parent69a8f08f3e7cc0a9121c7fdb3499081fb2e34ddf (diff)
downloadmpv-1301a907617459237fb0071b4640ad53d0ae491f.tar.bz2
mpv-1301a907617459237fb0071b4640ad53d0ae491f.tar.xz
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.
Diffstat (limited to 'demux/stheader.h')
-rw-r--r--demux/stheader.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/demux/stheader.h b/demux/stheader.h
index 1771f75ff5..082fffa5e2 100644
--- a/demux/stheader.h
+++ b/demux/stheader.h
@@ -31,7 +31,6 @@ struct demuxer;
struct sh_stream {
enum stream_type type;
- struct demuxer *demuxer;
// Index into demuxer->streams.
int index;
// Demuxer/format specific ID. Corresponds to the stream IDs as encoded in