From 454bae2c43d1f556fc711f3026c6f09899d9f7e4 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Fri, 10 May 2019 14:22:52 +0400 Subject: [PATCH] Make PacketQueue fields atomic to avoid data races (e.g. with ParseThread) --- extern/osg-ffmpeg-videoplayer/videostate.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/osg-ffmpeg-videoplayer/videostate.hpp b/extern/osg-ffmpeg-videoplayer/videostate.hpp index 6abaa64cd..54519f428 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.hpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.hpp @@ -80,8 +80,8 @@ struct PacketQueue { AVPacketList *first_pkt, *last_pkt; std::atomic flushing; - int nb_packets; - int size; + std::atomic nb_packets; + std::atomic size; OpenThreads::Mutex mutex; OpenThreads::Condition cond;