diff options
author | wm4 <wm4@nowhere> | 2014-11-01 00:05:24 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-01 00:05:24 +0100 |
commit | 650b57cd6e31c6881b78d5a311fc014552cf3ba0 (patch) | |
tree | 6a62b53a9a5146a5ffbe5f04ccba55c1f0d980ff | |
parent | 3f3a6b13bd05f6b0c0a68d8857699368a1949cd6 (diff) | |
download | mpv-650b57cd6e31c6881b78d5a311fc014552cf3ba0.tar.bz2 mpv-650b57cd6e31c6881b78d5a311fc014552cf3ba0.tar.xz |
cache: don't relay STREAM_CTRL_AVSEEK if it's unsupported
Thanks to STREAM_CTRL_HAS_AVSEEK, we actually know whether CTRL_AVSEEK
is implemented at all, and we can avoid a blocking wait on the cache if
demux_lavf sends CTRL_AVSEEK even if it won't wait. I'm hoping this
can't currently happen, but why hope if we can explicitly prevent it.
It'll make us more robust against future changes in libavformat.
-rw-r--r-- | stream/cache.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stream/cache.c b/stream/cache.c index 7bbbcd62c5..12c66a32bb 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -408,6 +408,10 @@ static int cache_get_cached_control(stream_t *cache, int cmd, void *arg) s->idle = s->eof = false; pthread_cond_signal(&s->wakeup); return STREAM_OK; + case STREAM_CTRL_AVSEEK: + if (!s->has_avseek) + return STREAM_UNSUPPORTED; + break; } return STREAM_ERROR; } |