summaryrefslogtreecommitdiffstats
path: root/src/modules/jack/module-jack-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/jack/module-jack-sink.c')
-rw-r--r--src/modules/jack/module-jack-sink.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c
index 4a0d3847..08a8befa 100644
--- a/src/modules/jack/module-jack-sink.c
+++ b/src/modules/jack/module-jack-sink.c
@@ -147,6 +147,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
pa_sample_spec ss;
/* Humm, we're not RUNNING, hence let's write some silence */
+ /* This can happen if we're paused, or during shutdown (when we're unlinked but jack is still running). */
ss = u->sink->sample_spec;
ss.channels = 1;
@@ -480,12 +481,12 @@ void pa__done(pa_module*m) {
if (!(u = m->userdata))
return;
- if (u->client)
- jack_client_close(u->client);
-
if (u->sink)
pa_sink_unlink(u->sink);
+ if (u->client)
+ jack_client_close(u->client);
+
if (u->thread) {
pa_asyncmsgq_send(u->thread_mq.inq, NULL, PA_MESSAGE_SHUTDOWN, NULL, 0, NULL);
pa_thread_free(u->thread);