mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
jack: don't wait for callbacks if the jack server shut down
Otherwise we'll wait forever. https://bugzilla.gnome.org/show_bug.cgi?id=747275
This commit is contained in:
parent
85b0c3a83d
commit
187d8acd5e
1 changed files with 7 additions and 1 deletions
|
@ -85,6 +85,7 @@ struct _GstJackAudioClient
|
|||
GstJackClientType type;
|
||||
gboolean active;
|
||||
gboolean deactivate;
|
||||
gboolean server_down;
|
||||
|
||||
JackShutdownCallback shutdown;
|
||||
JackProcessCallback process;
|
||||
|
@ -227,12 +228,16 @@ jack_shutdown_cb (void *arg)
|
|||
for (walk = conn->src_clients; walk; walk = g_list_next (walk)) {
|
||||
GstJackAudioClient *client = (GstJackAudioClient *) walk->data;
|
||||
|
||||
client->server_down = TRUE;
|
||||
g_cond_signal (&conn->flush_cond);
|
||||
if (client->shutdown)
|
||||
client->shutdown (client->user_data);
|
||||
}
|
||||
for (walk = conn->sink_clients; walk; walk = g_list_next (walk)) {
|
||||
GstJackAudioClient *client = (GstJackAudioClient *) walk->data;
|
||||
|
||||
client->server_down = TRUE;
|
||||
g_cond_signal (&conn->flush_cond);
|
||||
if (client->shutdown)
|
||||
client->shutdown (client->user_data);
|
||||
}
|
||||
|
@ -520,6 +525,7 @@ gst_jack_audio_client_new (const gchar * id, const gchar * server,
|
|||
client->buffer_size = buffer_size;
|
||||
client->sample_rate = sample_rate;
|
||||
client->user_data = user_data;
|
||||
client->server_down = FALSE;
|
||||
|
||||
/* add the client to the connection */
|
||||
gst_jack_audio_connection_add_client (conn, client);
|
||||
|
@ -600,7 +606,7 @@ gst_jack_audio_client_set_active (GstJackAudioClient * client, gboolean active)
|
|||
client->deactivate = TRUE;
|
||||
|
||||
/* need to wait for process_cb run once more */
|
||||
while (client->deactivate)
|
||||
while (client->deactivate && !client->server_down)
|
||||
g_cond_wait (&client->conn->flush_cond, &client->conn->lock);
|
||||
}
|
||||
client->active = active;
|
||||
|
|
Loading…
Reference in a new issue