diff options
author | wm4 <wm4@nowhere> | 2020-02-29 20:06:40 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-02-29 21:49:00 +0100 |
commit | c79619f11065bd630b05c191745bf54becd4c3b9 (patch) | |
tree | 955f13e3ba9a9e18878aacbac113422942f995eb /demux/demux.c | |
parent | 8fc2bc142211188344ebd73943133b9cb17d4431 (diff) | |
download | mpv-c79619f11065bd630b05c191745bf54becd4c3b9.tar.bz2 mpv-c79619f11065bd630b05c191745bf54becd4c3b9.tar.xz |
demux: add a way to block reading after seeks
Preparation for a future commit. The demuxer queues might be read from
other threads than the one to issue the seek, and passing SEEK_BLOCK
with such a seek will provide a convenient way to synchronize this.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c index e5df920c22..68edd029a1 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -3775,6 +3775,9 @@ static bool queue_seek(struct demux_internal *in, double seek_pts, int flags, bool force_seek = flags & SEEK_FORCE; flags &= ~(unsigned)SEEK_FORCE; + bool block = flags & SEEK_BLOCK; + flags &= ~(unsigned)SEEK_BLOCK; + struct demux_cached_range *cache_target = find_cache_seek_range(in, seek_pts, flags); @@ -3795,6 +3798,8 @@ static bool queue_seek(struct demux_internal *in, double seek_pts, int flags, clear_reader_state(in, clear_back_state); + in->blocked = block; + if (cache_target) { execute_cache_seek(in, cache_target, seek_pts, flags); } else { |