Bug #642
closedlive tv does not work correctly
0%
Description
on my vdr box the vdr interface is eth1
vdradmin.pl only checks eth0
the code:
sub live_stream { my $channel = $q->param("channel"); my $progname = $q->param("progname"); my ($data, $ifconfig, $ip); if ($CONFIG{ST_STREAMDEV_HOST}) { $ip = $CONFIG{ST_STREAMDEV_HOST}; } else { if ($CONFIG{VDR_HOST} eq "localhost") { $ifconfig = `/sbin/ifconfig eth0`; <---------- hardcoded eth0 :-/ if ($ifconfig =~ /inet.+:(\d+\.\d+\.\d+\.\d+)\s+Bcast/) { $ip = $1; } else { $ip = `hostname`; } } else { $ip = $CONFIG{VDR_HOST}; } } chomp($ip); $data = ""; $data .= "#EXTINF:0,$progname\n" if ($progname); $data .= "http://$ip:$CONFIG{ST_STREAMDEV_PORT}/$channel\n"; return (header("200", $CONFIG{TV_MIMETYPE}, $data)); }
so the function sets the hostname
but the hostname could only resolved by windows systems or *nix systems with an entry in the /etc/hosts file
Solution:
A var VDR_HOST_INTERFACE in the /etc/vdradmin/vdradmind.conf file
and change the code to something like
$ifconfig = `/sbin/ifconfig $VDR_HOST_INTERFACE`;
Then vdradmin.pl checks the right interface an does not set `hostname`
Perhaps a generally better solution could be to check the URL from which is vdradmin.pl called.
$ip = checkipfromurl();
$data .= "http://$ip:$CONFIG{ST_STREAMDEV_PORT}/$channel\n";
Example:
http://vdrbox/ --> $data .= "http://vdrbox/$CONFIG{ST_STREAMDEV_PORT}/$channel\n";
http://192.168.0.20/ --> $data .= "http://192.168.0.20:$CONFIG{ST_STREAMDEV_PORT}/$channel\n";
http://vdr.mydom.org/ --> $data .= "http://vdr.mydom.org:$CONFIG{ST_STREAMDEV_PORT}/$channel\n";
Then the started player reaches the stream in the same way the browser reaches vdradmin.pl