Fix some race conditions on that frame counter.

This commit is contained in:
Alcaro 2015-05-09 16:29:09 +02:00
parent 83e0164c93
commit 3ea56e67a9

View File

@ -955,10 +955,15 @@ static struct video_shader *thread_get_current_shader(void *data)
static uint64_t thread_get_frame_count(void *data)
{
uint64_t ret;
thread_video_t *thr = (thread_video_t*)data;
if (!thr || !thr->poke)
if (!thr)
return 0;
return thr->poke->get_frame_count(thr->driver_data);
slock_lock(thr->lock);
ret = thr->hit_count+thr->miss_count;
slock_unlock(thr->lock);
return ret;
}
static const video_poke_interface_t thread_poke = {