Project

General

Profile

Actions

Bug #642

closed

live tv does not work correctly

Added by Anonymous over 13 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
05/14/2011
Due date:
% Done:

0%

Estimated time:

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

Actions #1

Updated by SPAM over 13 years ago

  • Status changed from New to Assigned
  • Assignee set to SPAM

I don't think it makes much sense to add a VDR_HOST_INTERFACE variable - you can already get around the problem by using ST_STREAMDEV_HOST. But the second suggestion does make sense to me, I'll look into implementing it.

Actions #3

Updated by amair over 13 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF