summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-07-14 12:18:39 -0700
committerVito Caputo <vcaputo@pengaru.com>2020-07-14 15:51:38 -0700
commit7da36aa7d4d40d4303dc702aa42347711a5fff81 (patch)
treeb30fa0833d1432e640351cbb0012fcb789536d1d
parent91a1cfc1fc9bb46afe6a2faec5edbb59c2f07354 (diff)
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.
-rw-r--r--src/rmd_initialize_data.c1
-rw-r--r--src/rmd_types.h1
2 files changed, 2 insertions, 0 deletions
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;
© All Rights Reserved