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.15 2004/05/31 23:01:52 _cvs_stephen Exp $"; + constant cvs_version="$Id: icecast.pike,v 1.16 2004/06/04 08:29:22 _cvs_stephen 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:224: Inside #if constant(Parser.MP3)
  #if constant(Parser.MP3)    parser = Parser.MP3.File(fd);   #else    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; +  stream_position += sizeof(frame->data)*8000000 / frame->bitrate;    call_callbacks( frame->data );    }    if(!sizeof(callbacks))    {    stream_position = 0;    stream_start = realtime();    }    call_out( feeder_thread, 0.02 );    }   
Roxen.git/server/modules/icecast/icecast.pike:451:    string s = "";    if( !current_md )    current_md = stream->get_playlist()->metadata();    if( (current_md->name||current_md->path)+current_md->url != old_mdkey )    {    old_mdkey = (current_md->name||current_md->path)+current_md->url;    s = sprintf( "StreamTitle='%s';StreamUrl='%s';",    get_streamtitle(),    location->url || current_md->url );    } -  while( strlen(s) & 15 ) +  while( sizeof(s) & 15 )    s+= "\0";    s = " " + s; -  s[ 0 ]=(strlen(s)-1)/16; +  s[ 0 ]=(sizeof(s)-1)/16;    //if(s[0])    // werror("MD: %O\n", s );    return s;    }       void send_udptitle() {    if(!current_md) {    werror("No metadata found.\n");    return;    }
Roxen.git/server/modules/icecast/icecast.pike:529:   Code:   audio/x-mpegurl m3u         If your web host does not allow you to access your mime types, you can request that it be added or, if your web host supports it, you can use the .htaccess file to add the mime type to the server.      */       static void send_more()    { -  if( !strlen(current_block) ) +  if( !sizeof(current_block) )    {    headers_done = 1;    if( !sizeof(buffer) )    return;    current_block = buffer[0];       if( do_meta )    { -  meta_cnt += strlen( current_block ); +  meta_cnt += sizeof( current_block );    if( meta_cnt >= METAINTERVAL )    {    string meta = gen_metadata();    meta_cnt -= METAINTERVAL; -  int rest = strlen(current_block)-meta_cnt-1; -  sent_meta += strlen(meta); +  int rest = sizeof(current_block)-meta_cnt-1; +  sent_meta += sizeof(meta);    current_block = current_block[..rest]+meta+current_block[rest+1..];    }    }    buffer = buffer[1..];    sent++;    }    int n = -1;    catch( n = fd->write( current_block ));    if( n > 0 )    {
Roxen.git/server/modules/icecast/icecast.pike:668:       res += ("<td>URL</td><td colspan=3> <input name='"+prefix+"url' value='"+    Roxen.html_encode_string(m->url || "")+"' size=50/></td>");       return res+"</tr></table>";    }       string transform_from_form( string v, mapping va )    {    if( v == "" ) return "\0\0\0\0"; -  v = v[strlen(path())..]; +  v = v[sizeof(path())..];    return va[v+"loc"]+"\0"+va[v+"playlist"]+"\0"+va[v+"jingle"]    +"\0"+va[v+"conn"]+"\0"+va[v+"url"]+"\0"+va[v+"name"];    }       mapping decode_stream( string s )    {    mapping m = ([]);    array a = s/"\0";    m->location = a[0];    if( sizeof( a ) > 1 ) m->playlist = a[1];    if( sizeof( a ) > 2 ) m->jingle = a[2];    if( sizeof( a ) > 3 ) m->maxconn = (int)a[3];    if( sizeof( a ) > 4 ) m->url = a[4];    if( sizeof( a ) > 5 ) m->name = a[5]; -  if( !m->jingle || !strlen( m->jingle ) ) m_delete( m, "jingle" ); -  if( !m->url || !strlen( m->url ) ) m_delete( m, "url" ); -  if( !m->name || !strlen( m->name ) ) m_delete( m, "name" ); +  if( !m->jingle || !sizeof( m->jingle ) ) m_delete( m, "jingle" ); +  if( !m->url || !sizeof( m->url ) ) m_delete( m, "url" ); +  if( !m->name || !sizeof( m->name ) ) m_delete( m, "name" );    return m;    }    array(mapping) get_streams()    {    return map( query(), decode_stream );    }   }      void create()   {