mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
jack: only call shutdown_callback on errors
This commit is contained in:
parent
31cfd434da
commit
58c68f3260
1 changed files with 8 additions and 7 deletions
|
|
@ -231,8 +231,6 @@ struct client {
|
||||||
uint32_t node_id;
|
uint32_t node_id;
|
||||||
struct spa_source *socket_source;
|
struct spa_source *socket_source;
|
||||||
|
|
||||||
bool active;
|
|
||||||
|
|
||||||
JackThreadCallback thread_callback;
|
JackThreadCallback thread_callback;
|
||||||
void *thread_arg;
|
void *thread_arg;
|
||||||
JackThreadInitCallback thread_init_callback;
|
JackThreadInitCallback thread_init_callback;
|
||||||
|
|
@ -287,8 +285,8 @@ struct client {
|
||||||
uint32_t xrun_count;
|
uint32_t xrun_count;
|
||||||
|
|
||||||
unsigned int started:1;
|
unsigned int started:1;
|
||||||
|
unsigned int active:1;
|
||||||
|
unsigned int destroyed:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void init_port_pool(struct client *c, enum spa_direction direction)
|
static void init_port_pool(struct client *c, enum spa_direction direction)
|
||||||
|
|
@ -519,7 +517,9 @@ static void on_state_changed(void *data, enum pw_remote_state old,
|
||||||
client->error = true;
|
client->error = true;
|
||||||
/* fallthrough*/
|
/* fallthrough*/
|
||||||
case PW_REMOTE_STATE_UNCONNECTED:
|
case PW_REMOTE_STATE_UNCONNECTED:
|
||||||
if (client->shutdown_callback)
|
/* don't call shutdown when we do client_close, only
|
||||||
|
* on unexpected errors */
|
||||||
|
if (client->shutdown_callback && !client->destroyed)
|
||||||
client->shutdown_callback(client->shutdown_arg);
|
client->shutdown_callback(client->shutdown_arg);
|
||||||
/* fallthrough*/
|
/* fallthrough*/
|
||||||
case PW_REMOTE_STATE_CONNECTED:
|
case PW_REMOTE_STATE_CONNECTED:
|
||||||
|
|
@ -1990,6 +1990,7 @@ int jack_client_close (jack_client_t *client)
|
||||||
|
|
||||||
pw_thread_loop_stop(c->context.loop);
|
pw_thread_loop_stop(c->context.loop);
|
||||||
|
|
||||||
|
c->destroyed = true;
|
||||||
pw_core_destroy(c->context.core);
|
pw_core_destroy(c->context.core);
|
||||||
pw_thread_loop_destroy(c->context.loop);
|
pw_thread_loop_destroy(c->context.loop);
|
||||||
pw_main_loop_destroy(c->context.main);
|
pw_main_loop_destroy(c->context.main);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue