mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-03 13:16:04 +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
|
@ -85,6 +85,7 @@ struct _GstJackAudioClient
|
||||||
GstJackClientType type;
|
GstJackClientType type;
|
||||||
gboolean active;
|
gboolean active;
|
||||||
gboolean deactivate;
|
gboolean deactivate;
|
||||||
|
gboolean server_down;
|
||||||
|
|
||||||
JackShutdownCallback shutdown;
|
JackShutdownCallback shutdown;
|
||||||
JackProcessCallback process;
|
JackProcessCallback process;
|
||||||
|
@ -227,12 +228,16 @@ jack_shutdown_cb (void *arg)
|
||||||
for (walk = conn->src_clients; walk; walk = g_list_next (walk)) {
|
for (walk = conn->src_clients; walk; walk = g_list_next (walk)) {
|
||||||
GstJackAudioClient *client = (GstJackAudioClient *) walk->data;
|
GstJackAudioClient *client = (GstJackAudioClient *) walk->data;
|
||||||
|
|
||||||
|
client->server_down = TRUE;
|
||||||
|
g_cond_signal (&conn->flush_cond);
|
||||||
if (client->shutdown)
|
if (client->shutdown)
|
||||||
client->shutdown (client->user_data);
|
client->shutdown (client->user_data);
|
||||||
}
|
}
|
||||||
for (walk = conn->sink_clients; walk; walk = g_list_next (walk)) {
|
for (walk = conn->sink_clients; walk; walk = g_list_next (walk)) {
|
||||||
GstJackAudioClient *client = (GstJackAudioClient *) walk->data;
|
GstJackAudioClient *client = (GstJackAudioClient *) walk->data;
|
||||||
|
|
||||||
|
client->server_down = TRUE;
|
||||||
|
g_cond_signal (&conn->flush_cond);
|
||||||
if (client->shutdown)
|
if (client->shutdown)
|
||||||
client->shutdown (client->user_data);
|
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->buffer_size = buffer_size;
|
||||||
client->sample_rate = sample_rate;
|
client->sample_rate = sample_rate;
|
||||||
client->user_data = user_data;
|
client->user_data = user_data;
|
||||||
|
client->server_down = FALSE;
|
||||||
|
|
||||||
/* add the client to the connection */
|
/* add the client to the connection */
|
||||||
gst_jack_audio_connection_add_client (conn, client);
|
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;
|
client->deactivate = TRUE;
|
||||||
|
|
||||||
/* need to wait for process_cb run once more */
|
/* 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);
|
g_cond_wait (&client->conn->flush_cond, &client->conn->lock);
|
||||||
}
|
}
|
||||||
client->active = active;
|
client->active = active;
|
||||||
|
|
Loading…
Reference in a new issue