From 7da36aa7d4d40d4303dc702aa42347711a5fff81 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 14 Jul 2020 12:18:39 -0700 Subject: types: add avd_mutex to ProgData avd accesses aren't serialized currently despite occurring from concurrent threads. I'm reworking avd but this just introduces and initializes a mutex for the existing variable. --- src/rmd_initialize_data.c | 1 + src/rmd_types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/rmd_initialize_data.c b/src/rmd_initialize_data.c index 0f0a073..8443750 100644 --- a/src/rmd_initialize_data.c +++ b/src/rmd_initialize_data.c @@ -81,6 +81,7 @@ int rmdInitializeData(ProgData *pdata, EncData *enc_data, CacheData *cache_data) pthread_mutex_init(&pdata->yuv_mutex, NULL); pthread_mutex_init(&pdata->pause_mutex, NULL); pthread_mutex_init(&pdata->time_mutex, NULL); + pthread_mutex_init(&pdata->avd_mutex, NULL); pthread_cond_init(&pdata->time_cond, NULL); pthread_cond_init(&pdata->pause_cond, NULL); pthread_cond_init(&pdata->image_buffer_ready, NULL); diff --git a/src/rmd_types.h b/src/rmd_types.h index 6018955..159434a 100644 --- a/src/rmd_types.h +++ b/src/rmd_types.h @@ -329,6 +329,7 @@ struct _ProgData { pthread_mutex_t pause_mutex; pthread_mutex_t time_mutex; + pthread_mutex_t avd_mutex; #ifdef HAVE_LIBASOUND snd_pcm_t *sound_handle; -- cgit v1.2.3