From 650b57cd6e31c6881b78d5a311fc014552cf3ba0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 1 Nov 2014 00:05:24 +0100 Subject: 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. --- stream/cache.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- cgit v1.2.3