Kill pulse-audio and opus-tasks at bye

parent f8667ac8
Pipeline #1312 passed with stage
in 11 minutes and 18 seconds
......@@ -272,3 +272,10 @@ Semaphore opus-block-sem
"" write-record close-rec raw$ $free ;
previous
0 warnings !@
: bye ( -- )
opus-task ?dup-IF
opus-task kill 0 to opus-task 5 ms
THEN bye ;
warnings !
......@@ -291,4 +291,24 @@ Defer write-record
pa-ctx "stereo-play" ss[ cm[ pa_channel_map_init_stereo
pa_stream_new dup to stereo-play ba[ read-record play-rest ;
previous pulse set-current
event: :>kill-pulse ( -- )
mono-play ?dup-IF pa_stream_disconnect ?pa-ior 0 to mono-play THEN
stereo-play ?dup-IF pa_stream_disconnect ?pa-ior 0 to stereo-play THEN
mono-rec ?dup-IF pa_stream_disconnect ?pa-ior 0 to mono-rec THEN
stereo-rec ?dup-IF pa_stream_disconnect ?pa-ior 0 to stereo-rec THEN
pa-ml ?dup-IF pa_mainloop_free 0 to pa-ml THEN
0 to pa-task kill-task ;
: kill-pulse ( -- )
pa-task IF
<event :>kill-pulse pa-task event>
5 0 DO pa-task 0= ?LEAVE 1 ms LOOP
THEN ;
set-current
previous pulse
0 warnings !@
: bye ( -- )
kill-pulse bye ;
warnings !
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment