summaryrefslogtreecommitdiffstats
path: root/perl-install
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
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')
-rw-r--r--perl-install/NEWS1
-rwxr-xr-xperl-install/standalone/drakdvb20
2 files changed, 20 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index b8390f565..675e0a197 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -4,6 +4,7 @@
o really don't set extents option for ext4
- drakdvb:
o sort channels list
+ o prefer vlc if present
Version 11.88 - 16 February 2009
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},