mirror of https://github.com/mpv-player/mpv
stream: use relaxed atomic loads for checking playback aborts
Seems appropriate, and will probably avoid performance surprises with
scary architectures which don't have trivial implementations for atomic
loads. (Consider that demux_mkv calls this very often now, and
libavformat demuxers and streams did this for a while now.)
(cherry picked from commit b9307b7175
)
This commit is contained in:
parent
2b737f8bfc
commit
b414d9a9a7
|
@ -987,7 +987,7 @@ void mp_cancel_reset(struct mp_cancel *c)
|
|||
// For convenience, c==NULL is allowed.
|
||||
bool mp_cancel_test(struct mp_cancel *c)
|
||||
{
|
||||
return c ? atomic_load(&c->triggered) : false;
|
||||
return c ? atomic_load_explicit(&c->triggered, memory_order_relaxed) : false;
|
||||
}
|
||||
|
||||
// Wait until the even is signaled. If the timeout (in seconds) expires, return
|
||||
|
|
Loading…
Reference in New Issue