[vlc-commits] display: relax invalid pictures memory ordering

Rémi Denis-Courmont git at videolan.org
Wed Jan 2 17:54:34 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jan  2 12:19:36 2019 +0200| [1f439e7d8c97b0a931cff6c01860b8e324e92f6c] | committer: Rémi Denis-Courmont

display: relax invalid pictures memory ordering

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f439e7d8c97b0a931cff6c01860b8e324e92f6c
---

 src/video_output/display.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 762a61d435..56b0784c3c 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -379,7 +379,7 @@ void vout_display_SendEventPicturesInvalid(vout_display_t *vd)
 
     msg_Warn(vd, "picture buffers invalidated");
     assert(vd->info.has_pictures_invalid);
-    atomic_store(&osys->reset_pictures, true);
+    atomic_store_explicit(&osys->reset_pictures, true, memory_order_release);
 }
 
 static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
@@ -482,9 +482,11 @@ static void vout_display_Reset(vout_display_t *vd)
 {
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
 
-    if (likely(!atomic_exchange(&osys->reset_pictures, false)))
+    if (likely(!atomic_exchange_explicit(&osys->reset_pictures, false,
+                                         memory_order_relaxed)))
         return;
 
+    atomic_thread_fence(memory_order_acquire);
     VoutDisplayDestroyRender(vd);
 
     if (osys->pool != NULL) {



More information about the vlc-commits mailing list