summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-01 00:05:24 +0100
committerwm4 <wm4@nowhere>2014-11-01 00:05:24 +0100
commit650b57cd6e31c6881b78d5a311fc014552cf3ba0 (patch)
tree6a62b53a9a5146a5ffbe5f04ccba55c1f0d980ff
parent3f3a6b13bd05f6b0c0a68d8857699368a1949cd6 (diff)
downloadmpv-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.c4
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;
}