History

devaudio-pipewire: destroy stream on close

We were leaking these streams before, which causes pipewire to hang when the user changes the default sink.

Jacob Moody committed 3 years ago

Commit ebe7cc61 parent 45d5ae01 file · +7 −9Browse files

Unified · Split

kern/devaudio-pipewire.c+7−9
@@ -84,17 +84,14 @@ audiodevopen(void) · 83 unmodified lines
8484
8585 lock(&pwstate.lk);
8686 pwstate.written = 0;
87− if(pwstate.init > 0){
88− kproc("pipewire main loop", pwproc, pwstate.loop);
89− unlock(&pwstate.lk);
90− return;
87+ if(pwstate.init == 0){
88+ pw_init(&argc, (char***)&argv);
89+ pwstate.init++;
90+ pwstate.loop = pw_main_loop_new(NULL);
91+ if(pwstate.loop == NULL)
92+ sysfatal("could not create loop");
9193 }
9294
93− pwstate.init++;
94− pw_init(&argc, (char***)&argv);
95− pwstate.loop = pw_main_loop_new(NULL);
96− if(pwstate.loop == NULL)
97− sysfatal("could not create loop");
9895 pwstate.output = pw_stream_new_simple(
9996 pw_main_loop_get_loop(pwstate.loop),
10097 "drawterm",
@@ -139,6 +136,7 @@ void · 38 unmodified lines
139136 audiodevclose(void)
140137 {
141138 pw_main_loop_quit(pwstate.loop);
139+ pw_stream_destroy(pwstate.output);
142140 }
143141
144142 int

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t