Skip to content

Commit

Permalink
Fix crash when starting "All Desktop Audio" without nodes (#69)
Browse files Browse the repository at this point in the history
* Fix #66

* Write '[]' to portsFile instead of using /dev/null
  • Loading branch information
alansartorio authored Oct 26, 2023
1 parent 529a047 commit a440766
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion native/connector/connect-and-monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ UtilLog "[connect-and-monitor.sh] [Got Streams] File: $streamsFile"
streamIds=`cat "$streamsFile" | jq -c '.[].id' | paste -sd ','`
UtilLog "[connect-and-monitor.sh] [Got Stream IDs] IDs: $streamIds"

cat "$fullDumpFile" | jq -c "[ .[] | select(.type == \"PipeWire:Interface:Port\") | select(.info.direction == \"output\") | select(.info.props[\"node.id\"] | contains($streamIds)) ]" > $portsFile
if [[ -n "$streamIds" ]]; then
cat "$fullDumpFile" | jq -c "[ .[] | select(.type == \"PipeWire:Interface:Port\") | select(.info.direction == \"output\") | select(.info.props[\"node.id\"] | contains($streamIds)) ]" > $portsFile
else
echo '[]' > $portsFile
fi
UtilLog "[connect-and-monitor.sh] [Got Ports] File: $portsFile"

if [[ ! "$targetNodeSerial" -eq "-1" ]]; then
Expand Down

0 comments on commit a440766

Please sign in to comment.