diff options
author | wm4 <wm4@nowhere> | 2014-04-25 19:12:24 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-25 19:12:24 +0200 |
commit | e0cf983e53afa6a524821265c7547c11f5c79551 (patch) | |
tree | 4ea1c5f0b17464e6b503c23be14b935cba0090d4 /stream/cache.c | |
parent | 3d51ef3dc83ea59a47c0eccf4ae93ae2a441ceb7 (diff) | |
download | mpv-e0cf983e53afa6a524821265c7547c11f5c79551.tar.bz2 mpv-e0cf983e53afa6a524821265c7547c11f5c79551.tar.xz |
stream: remove interrupt callback global variables
This used global variables for the asynchronous interrupt callback.
Pick the simple and dumb solution and stuff the callback into
mpv_global. Do this because interrupt checking should also work in the
connect phase, and currently stream creation equates connecting.
Ideally, this would be passed to the stream on creation instead, or
connecting would be separated from creation. But since I don't know yet
which is better, and since moving stream/demuxer into their own thread
is something that will happen later, go with the mpv_global solution.
Diffstat (limited to 'stream/cache.c')
-rw-r--r-- | stream/cache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/cache.c b/stream/cache.c index a261a0ecf2..f0d132ad64 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -150,7 +150,7 @@ static int64_t mp_clipi64(int64_t val, int64_t min, int64_t max) // Returns CACHE_INTERRUPTED if the caller is supposed to abort. static int cache_wakeup_and_wait(struct priv *s, double *retry_time) { - if (stream_check_interrupt(0)) + if (stream_check_interrupt(s->cache)) return CACHE_INTERRUPTED; double start = mp_time_sec(); @@ -702,7 +702,7 @@ int stream_cache_init(stream_t *cache, stream_t *stream, int64_t size, // wait until cache is filled at least prefill_init % for (;;) { - if (stream_check_interrupt(0)) + if (stream_check_interrupt(cache)) return 0; int64_t fill; int idle; |