summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakdvb
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-02-19 16:57:44 +0000
committerOlivier Blin <oblin@mandriva.com>2009-02-19 16:57:44 +0000
commit0df491015e36fdae8eaf1aa60a70614096ac24e9 (patch)
tree1877d3219e86952b435ccb5f9e8cad2ad626ea5d /perl-install/standalone/drakdvb
parent5aa3441b1700c56b6e478a904c0469b80de4853c (diff)
downloaddrakx-0df491015e36fdae8eaf1aa60a70614096ac24e9.tar
drakx-0df491015e36fdae8eaf1aa60a70614096ac24e9.tar.gz
drakx-0df491015e36fdae8eaf1aa60a70614096ac24e9.tar.bz2
drakx-0df491015e36fdae8eaf1aa60a70614096ac24e9.tar.xz
drakx-0df491015e36fdae8eaf1aa60a70614096ac24e9.zip
prefer vlc if present
Diffstat (limited to 'perl-install/standalone/drakdvb')
-rwxr-xr-xperl-install/standalone/drakdvb20
1 files changed, 19 insertions, 1 deletions
diff --git a/perl-install/standalone/drakdvb b/perl-install/standalone/drakdvb
index 531701862..84d7f077e 100755
--- a/perl-install/standalone/drakdvb
+++ b/perl-install/standalone/drakdvb
@@ -110,9 +110,27 @@ sub load_channels() {
}
}
+sub get_channel_info {
+ my ($channel) = @_;
+ foreach (cat_($config_file)) {
+ chomp;
+ my %channel_info;
+ @channel_info{qw(name frequency options vpid apid serviceid)} = /^([^:]+):([^:]+):(.*):([^:]+):([^:]+):([^:]+)+$/;
+ next if $channel_info{name} ne $channel;
+ ($channel_info{bandwidth}) = $channel_info{options} =~ /\bBANDWIDTH_(\d+)_MHZ\b/;
+ return \%channel_info;
+ }
+ undef;
+}
+
sub launch_tv() {
my $channel = get_selected_channel() or return;
- system('mplayer "dvb://' . $channel . '"&');
+ if (whereis_binary("vlc")) {
+ my $info = get_channel_info($channel) or return;
+ system("vlc dvb:// --dvb-frequency=$info->{frequency} --dvb-adapter=0 --dvb-bandwidth=$info->{bandwidth} --program=$info->{serviceid} &");
+ } else {
+ system('mplayer "dvb://' . $channel . '"&');
+ }
}
gtkadd($w->{window},