From 22c002138d8b82a021564ddab447fafd90852e75 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 6 May 2018 13:00:05 +0200 Subject: misc: add a synchronization helper This is almost like rendezvous(), except it allows async wakeup, and does not require global state. It will be used by a later commit. struct mp_waiter is intended to be allocated on the stack, and uses an initializer including PTHREAD_MUTEX_INITIALIZER. This is the first case in mpv that it uses PTHREAD_MUTEX_INITIALIZER for stack-allocated mutexes. It seems POSIX still does not allow this formally, but since POSIX is worth less than used toilet paper, I don't really care. Modern OSes use futexes, which means you can make _every_ memory location a lock, and this code tries to make use of it, without using OS specific code. The name of the source file is rather generic, because I intend to dump further small helpers there (or maybe move mp_rendezvous() to it). --- wscript_build.py | 1 + 1 file changed, 1 insertion(+) (limited to 'wscript_build.py') diff --git a/wscript_build.py b/wscript_build.py index 4b9b60e569..e37eb7e775 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -323,6 +323,7 @@ def build(ctx): ( "misc/rendezvous.c" ), ( "misc/ring.c" ), ( "misc/thread_pool.c" ), + ( "misc/thread_tools.c" ), ## Options ( "options/m_config.c" ), -- cgit v1.2.3 From 559a400ac36e75a8d73ba263fd7fa6736df1c2da Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 31 Aug 2018 12:48:36 +0200 Subject: demux, stream: rip out the classic stream cache The demuxer cache is the only cache now. Might need another change to combat seeking failures in mp4 etc. The only bad thing is the loss of cache-speed, which was sort of nice to have. --- wscript_build.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'wscript_build.py') diff --git a/wscript_build.py b/wscript_build.py index e37eb7e775..066ede1274 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -357,8 +357,6 @@ def build(ctx): ( "stream/ai_oss.c", "oss-audio && audio-input" ), ( "stream/ai_sndio.c", "sndio && audio-input" ), ( "stream/audio_in.c", "audio-input" ), - ( "stream/cache.c" ), - ( "stream/cache_file.c" ), ( "stream/cookies.c" ), ( "stream/dvb_tune.c", "dvbin" ), ( "stream/frequencies.c", "tv" ), -- cgit v1.2.3