diff options
author | wm4 <wm4@nowhere> | 2013-05-24 18:49:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-16 22:05:09 +0200 |
commit | 7c4202b863752e5903c76231420d9b391a0961e1 (patch) | |
tree | 4d3764b375bed6c60685b3bbd9a1fdeee5d40dcb /configure | |
parent | 27b633671f01a0f97518459717d273f45358bfb0 (diff) | |
download | mpv-7c4202b863752e5903c76231420d9b391a0961e1.tar.bz2 mpv-7c4202b863752e5903c76231420d9b391a0961e1.tar.xz |
cache: make the stream cache a proper stream that wraps other streams
Before this commit, the cache was franken-hacked on top of the stream
API. You had to use special functions (like cache_stream_fill_buffer()
instead of stream_fill_buffer()), which would access the stream in a
cached manner.
The whole idea about the previous design was that the cache runs in a
thread or in a forked process, while the cache awa functions made sure
the stream instance looked consistent to the user. If you used the
normal functions instead of the special ones while the cache was
running, you were out of luck.
Make it a bit more reasonable by turning the cache into a stream on its
own. This makes it behave exactly like a normal stream. The stream
callbacks call into the original (uncached) stream to do work. No
special cache functions or redirections are needed. The only different
thing about cache streams is that they are created by special functions,
instead of being part of the auto_open_streams[] array.
To make things simpler, remove the threading implementation, which was
messed into the code. The threading code could perhaps be kept, but I
don't really want to have to worry about this special case. A proper
threaded implementation will be added later.
Remove the cache enabling code from stream_radio.c. Since enabling the
cache involves replacing the old stream with a new one, the code as-is
can't be kept. It would be easily possible to enable the cache by
requesting a cache size (which is also much simpler). But nobody uses
stream_radio.c and I can't even test this thing, and the cache is
probably not really important for it either.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -495,7 +495,6 @@ _priority=no def_dos_paths="#define HAVE_DOS_PATHS 0" def_stream_cache="#define CONFIG_STREAM_CACHE 1" def_priority="#undef CONFIG_PRIORITY" -def_pthread_cache="#undef PTHREAD_CACHE" need_shmem=yes _build_man=auto for ac_option do @@ -1453,13 +1452,9 @@ else fi echores "$_pthreads" -if cygwin ; then - if test "$_pthreads" = yes ; then - def_pthread_cache="#define PTHREAD_CACHE 1" - else - _stream_cache=no - def_stream_cache="#undef CONFIG_STREAM_CACHE" - fi +if cygwin || mingw32 ; then + _stream_cache=no + def_stream_cache="#undef CONFIG_STREAM_CACHE" fi echocheck "rpath" @@ -3239,7 +3234,6 @@ $def_priority /* configurable options */ $def_stream_cache -$def_pthread_cache /* CPU stuff */ |