On 10 Nov, Mark Lehrer wrote:
> 
> I'm digging through the code here and it is leading me to a bunch of
> files that say MP3 Decoder originally Copyright (C) 1995-1997 Xing
> Technology
> 
> Are most of these streaming mp3 players based on this same code?
> Although freeamp does a better job than other mp3 players, I get this
> same symptom in Winamp, xmms, and freeamp - audio_decode is sometimes
> returning 0 and I haven't followed the code through yet, but this is
> obviously bad.  Perhaps it keeps re-trying the frame until it is
> successful or something.

No, the xing engine is found in the real jukebox and in freeamp. It
probably is in a lot of other places by now, but not Winamp or XMMS.
If other players are exhibiting the same symptoms I would suspect
icecast or the bitstream itself. Can you capture a section of the
bitstream with the following perl script and then send me about 30
seconds worth of the stream? 

If the saved file does not play back correctly using normal file
playback in FreeAmp then its an icecast problem. If it does, its a
freeamp problem...


--ruaok         Freezerburn! All else is only icing. -- Soul Coughing

Robert Kaye -- [EMAIL PROTECTED]  http://moon.eorbit.net/~robert
#!/usr/bin/perl -w

use strict;
use Socket;

use constant BLOCK_SIZE => 1024;
use constant TRUE => 1;
use constant FALSE => 0;

sub SaveStream
{
    my $remote = $_[0];
    my $port = $_[1];
    my $size = $_[2];
    my $file = $_[3];
    my ($iaddr, $paddr, $proto);
    my ($line,  $ret, $rest, $query);
    my ($space, $read, $myhost, $i);

    $iaddr = inet_aton($remote);
    $paddr = sockaddr_in($port, $iaddr);
    $proto = getprotobyname('tcp');

    if (!socket(SOCK, PF_INET, SOCK_STREAM, $proto))
    {
        print "Cannot create socket\n";
        return;
    }

    if (!connect(SOCK, $paddr))
    {
        print "Cannot connect to server\n";
        return;
    }
    print ("Connected to server...\n");
    
    send(SOCK, "GET / HTTP/1.0\n\n\n", 0);

    for(;;)
    {
       $line = <SOCK>;
       print $line;

       chop($line);
       chop($line);
       if (length($line) == 0)
       {
           last;
       }
    }

    open(TEMP, ">$file") or die"Cannot open file $file.\n";

    $read = 0;
         for(; $read < $size;)
         {
        $ret = read SOCK, $line, 
                   ($size < BLOCK_SIZE) ? $size : BLOCK_SIZE;
        if (!defined $ret)
                  {
                    last;
                  }
                  $read += $ret;

        print "Read $read bytes\n";
                  print TEMP $line;
         }
         close(TEMP);
    close(SOCK);
}

if (scalar(@ARGV) < 4)
{
    print "\nUsage: savestream.pl <host> <port> <num bytes to save> <file to save 
to>\n\n";

    exit(0);
}

my ($host, $port, $size, $file);

$host = shift;
$port = shift;
$size = shift;
$file = shift;

SaveStream($host, $port, $size, $file);

Reply via email to