output: consistently lock audio output objects

Always keep the audio_output object locked within the output thread,
unless a plugin method is called.  This fixes several race conditions.
This commit is contained in:
Max Kellermann
2009-10-29 17:06:40 +01:00
parent 1403172ef3
commit bde3d14339
7 changed files with 105 additions and 52 deletions

View File

@@ -191,9 +191,9 @@ audio_output_init(struct audio_output *ao, const struct config_param *param,
assert(ao->filter != NULL);
ao->thread = NULL;
notify_init(&ao->notify);
ao->command = AO_COMMAND_NONE;
ao->mutex = g_mutex_new();
ao->cond = g_cond_new();
ao->data = ao_plugin_init(plugin,
&ao->config_audio_format,