fix(audio): apply host_env outermost to the pw-record spawn
host_env() now wraps the whole child environment, and the stream.capture.sink property is merged inside it, which is the form the host_process convention expects. The two capture tests patch os.environ instead of host_env. Fixes #41
This commit is contained in:
@@ -401,7 +401,7 @@ class PipeWireCaptureSource:
|
||||
],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL,
|
||||
env=_capture_sink_env(host_env()),
|
||||
env=host_env(_capture_sink_env(os.environ)),
|
||||
)
|
||||
|
||||
def reopen(
|
||||
|
||||
@@ -355,7 +355,7 @@ class TestPipeWireCaptureSource(unittest.TestCase):
|
||||
calls: List[Tuple[List[str], Dict[str, Any]]] = []
|
||||
with (
|
||||
patch("vocalinux.audio.pipewire.resolve_pipewire_source", return_value=_source()),
|
||||
patch("vocalinux.audio.pipewire.host_env", return_value={"PATH": "/usr/bin"}),
|
||||
patch.dict("os.environ", {"PATH": "/usr/bin"}, clear=True),
|
||||
):
|
||||
capture = PipeWireCaptureSource(
|
||||
device_index=PIPEWIRE_INDEX_BASE,
|
||||
@@ -374,10 +374,7 @@ class TestPipeWireCaptureSource(unittest.TestCase):
|
||||
user_props = "{ node.latency = 1024/48000 }"
|
||||
with (
|
||||
patch("vocalinux.audio.pipewire.resolve_pipewire_source", return_value=_source()),
|
||||
patch(
|
||||
"vocalinux.audio.pipewire.host_env",
|
||||
return_value={"PIPEWIRE_PROPS": user_props},
|
||||
),
|
||||
patch.dict("os.environ", {"PIPEWIRE_PROPS": user_props}, clear=True),
|
||||
):
|
||||
capture = PipeWireCaptureSource(
|
||||
device_index=PIPEWIRE_INDEX_BASE,
|
||||
|
||||
Reference in New Issue
Block a user