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:
wm4 2015-03-09 22:35:10 +01:00 committed by Diogo Franco (Kovensky)
parent 2b737f8bfc
commit b414d9a9a7
1 changed files with 1 additions and 1 deletions

View File

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