summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
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},