summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/tweaker/bin/twk_audio.pl
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/tweaker/bin/twk_audio.pl')
-rwxr-xr-xabs/core-testing/tweaker/bin/twk_audio.pl16
1 files changed, 11 insertions, 5 deletions
diff --git a/abs/core-testing/tweaker/bin/twk_audio.pl b/abs/core-testing/tweaker/bin/twk_audio.pl
index 72b9c86..b3bdd89 100755
--- a/abs/core-testing/tweaker/bin/twk_audio.pl
+++ b/abs/core-testing/tweaker/bin/twk_audio.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright 2007, 2008 Robert ("Bob") Igo of StormLogic, LLC and mythic.tv.
+# Copyright 2007-2009 Robert ("Bob") Igo of StormLogic, LLC and mythic.tv.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,11 +30,16 @@ sub poll_for_digital_output_device {
my @digital_matches = ( "digital", "IEC958" );
my $results = execute_shell_command($poll_command);
- foreach my $digital_match (@digital_matches) {
- if ($results =~ /card (\d):.*device (\d).*$digital_match.*/i) {
- $card = $1;
- $device = $2;
+ if ($results) {
+ foreach my $digital_match (@digital_matches) {
+ if ($results =~ /card (\d):.*device (\d).*$digital_match.*/i) {
+ $card = $1;
+ $device = $2;
+ }
}
+ } else {
+ recommendation_level("not available", "No audio devices detected.");
+ exit(-1);
}
return ($card, $device);
}
@@ -336,6 +341,7 @@ sub poll_options {
}
}
case "analogsurround" {
+ my ($card, $device) = poll_for_digital_output_device;
recommendation_level("unsupported", "No configuration data exists yet for this option.");
}
case "digital" {