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.
This commit is contained in:
wm4 2014-11-01 00:05:24 +01:00
parent 3f3a6b13bd
commit 650b57cd6e
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}