mixer: protect the mixer struct with a mutex
In some rare cases, there was a race condition between the output thread and the main thread: when you disable/enable an output device in the main thread, this caused a crash in the output thread. Protect the whole mixer struct with a GMutex to prevent that.
This commit is contained in:
@@ -19,8 +19,6 @@
|
||||
|
||||
#include "mixer_api.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#undef G_LOG_DOMAIN
|
||||
#define G_LOG_DOMAIN "mixer"
|
||||
|
||||
@@ -28,4 +26,5 @@ void
|
||||
mixer_init(struct mixer *mixer, const struct mixer_plugin *plugin)
|
||||
{
|
||||
mixer->plugin = plugin;
|
||||
mixer->mutex = g_mutex_new();
|
||||
}
|
||||
|
Reference in New Issue
Block a user