mirror of
https://github.com/mpv-player/mpv
synced 2025-02-05 14:42:24 +00:00
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:
parent
3f3a6b13bd
commit
650b57cd6e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user