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
1diff --git a/bin/gst_pipeline_test b/bin/gst_pipeline_test
2index 4d9f3c4..f6b6703 100755
3--- a/bin/gst_pipeline_test
4+++ b/bin/gst_pipeline_test
5@@ -17,14 +17,14 @@ from subprocess import check_output
6 def check_state(device):
7 """Checks whether the sink is available for the given device.
8 """
9- sink_info = check_output(['pacmd', 'list-sinks'],
10+ sink_info = check_output(['pactl', 'list', 'sinks'],
11 universal_newlines=True)
12
13 data = sink_info.split("\n")
14 try:
15- device_name = re.findall(".*name:\s.*%s.*" % device, sink_info)[0].lstrip()
16- sink = re.findall(".*name:\s<(.*%s.*)>" % device, sink_info)[0].lstrip()
17- status = data[data.index("\t" + device_name) + 3]
18+ device_name = re.findall(".*Name:\s.*%s.*" % device, sink_info)[0].lstrip()
19+ sink = re.findall(".*Name:\s(.*%s.*)" % device, sink_info)[0].lstrip()
20+ status = data[data.index("\t" + device_name) - 1]
21 except (IndexError, ValueError):
22 logging.error("Failed to find status for device: %s" % device)
23 return False

Subscribers

People subscribed via source and target branches