Commit 69862eca authored by Rafaël Carré's avatar Rafaël Carré
Browse files

thumbnailer: protect read access to the condition variable

parent 884a4faf
......@@ -2,6 +2,7 @@
#include <jni.h>
#include <vlc/vlc.h>
#include <pthread.h>
#include <stdbool.h>
#define LOG_TAG "VLC/JNI/thumbnailer"
#include "log.h"
......@@ -49,7 +50,10 @@ static void thumbnailer_unlock(void *opaque, void *picture, void *const *p_pixel
thumbnailer_sys_t *p_sys = opaque;
/* If we have already received a thumbnail, we skip this frame. */
if (p_sys->b_hasThumb == 1)
pthread_mutex_lock(&p_sys->doneMutex);
bool hasThumb = p_sys->b_hasThumb;
pthread_mutex_unlock(&p_sys->doneMutex);
if (hasThumb)
return;
p_sys->i_nbReceivedFrames++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment