Roxen.git / server / modules / icecast / icecast.pike

version» Context lines:

Roxen.git/server/modules/icecast/icecast.pike:1:   // This is a ChiliMoon module. Copyright © 2001, Roxen IS.      inherit "module"; - constant cvs_version="$Id: icecast.pike,v 1.12 2002/11/11 01:54:01 mani Exp $"; + constant cvs_version="$Id: icecast.pike,v 1.13 2002/11/19 00:56:27 _cvs_hop Exp $";   constant thread_safe=1;      #define BSIZE 16384   #define METAINTERVAL 8192      #include <module.h>   #include <roxen.h>   #include <stat.h>   #include <request_trace.h>   
Roxen.git/server/modules/icecast/icecast.pike:105:      class MPEGStream   {    array(function) callbacks = ({});    int bitrate; // bits/second    int stream_start=realtime(), stream_position; // µSeconds    Stdio.File fd;   #if constant(Parser.MP3)    Parser.MP3.File parser;   #else -  Audio.MP3.decode parser; +  Audio.Format.MP3 parser;   #endif    Playlist playlist;    string cmd;       mixed get_playlist() {    if(!playlist || zero_type(playlist["current_file"])) {    // playlist object is lost    werror("DEB: playlist %O is lost!\n", "???");    return 0;    }
Roxen.git/server/modules/icecast/icecast.pike:205:    cmd = 0;    }    while( sizeof(callbacks) &&    ((realtime()-stream_start) > stream_position) )    {    mapping frame;    if(!parser)   #if constant(Parser.MP3)    parser = Parser.MP3.File(fd);   #else -  parser = Audio.MP3.decode(fd); +  parser = Audio.Format.MP3(); +  parser->buffer = Audio.Format.vbuffer(fd);   #endif    frame = parser->get_frame();    while( !frame )    {    fd->set_blocking();    fd->close();    fd = get_playlist()->next_file();   #if constant(Parser.MP3)    parser = Parser.MP3.File(fd);   #else -  parser = Audio.MP3.decode(fd); +  parser = Audio.Format.MP3(); +  parser->buffer = Audio.Format.vbuffer(fd);   #endif    frame = parser->get_frame();    }    // Actually, this is supposed to be quite constant, but not all    // frames are the same size.    stream_position += strlen(frame->data)*8000000 / frame->bitrate;    call_callbacks( frame->data );    }    if(!sizeof(callbacks))    {