Merge ~sylvain-pineau/plainbox-provider-checkbox:pactl_gst_pipeline_test into plainbox-provider-checkbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 2617c9cba1f0c54561d20ed34c1e3fa2594311f8
Merged at revision: 8ec10e72fde02b3607d276c8e718b651d758b0e8
Proposed branch: ~sylvain-pineau/plainbox-provider-checkbox:pactl_gst_pipeline_test
Merge into: plainbox-provider-checkbox:master
Diff against target: 23 lines (+4/-4)
1 file modified
bin/gst_pipeline_test (+4/-4)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+367693@code.launchpad.net

Description of the change

A similar fix already landed a while ago in audio_settings (checkbox-support scripts), this patch just does the same thing in gst_pipeline_test.

Tested on both 16.04/18.04.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/gst_pipeline_test b/bin/gst_pipeline_test
index 4d9f3c4..f6b6703 100755
--- a/bin/gst_pipeline_test
+++ b/bin/gst_pipeline_test
@@ -17,14 +17,14 @@ from subprocess import check_output
17def check_state(device):17def check_state(device):
18 """Checks whether the sink is available for the given device.18 """Checks whether the sink is available for the given device.
19 """19 """
20 sink_info = check_output(['pacmd', 'list-sinks'],20 sink_info = check_output(['pactl', 'list', 'sinks'],
21 universal_newlines=True)21 universal_newlines=True)
2222
23 data = sink_info.split("\n")23 data = sink_info.split("\n")
24 try:24 try:
25 device_name = re.findall(".*name:\s.*%s.*" % device, sink_info)[0].lstrip()25 device_name = re.findall(".*Name:\s.*%s.*" % device, sink_info)[0].lstrip()
26 sink = re.findall(".*name:\s<(.*%s.*)>" % device, sink_info)[0].lstrip()26 sink = re.findall(".*Name:\s(.*%s.*)" % device, sink_info)[0].lstrip()
27 status = data[data.index("\t" + device_name) + 3]27 status = data[data.index("\t" + device_name) - 1]
28 except (IndexError, ValueError):28 except (IndexError, ValueError):
29 logging.error("Failed to find status for device: %s" % device)29 logging.error("Failed to find status for device: %s" % device)
30 return False30 return False

Subscribers

People subscribed via source and target branches