[Icecast-dev] Re: Fallback trouble with icecast 2.1kh

Iceuse - Kris iceuse at wwlang.net
Wed Dec 15 15:29:31 PST 2004


In fact, after further investigation, the client receives data, but it 
seams those data are lacking an end of stream or end of packet tag.

Trying to be clearer, here is an extract of the algorithm, with in 
UPPERCASE the value of the conditions.
      while (eos == 0)
      {
        while (eos == 0)
        {
          int result = oy.pageout(og);
          if (result == 0) SOMETIMES FALSE
            break; // need more data 
          if (result == -1)
          {
            // missing or corrupt data at this page position
          }
          else
          {
            os.pagein(og);
            while (true)
            {
              result = os.packetout(op);
              if (result == 0)ALWAYS TRUE
                break; // need more data 
              if (result == -1)
              {
                // missing or corrupt data at this page position
                // no reason to complain; already complained above
              }
              else
              {
                // we have a packet.  Decode it
                NEVER REACHES THIS POINT
              }
            }
            if (og.eos() != 0) ALWAYS FALSE
              eos = 1;
          }
        }

        if (eos == 0)
        {
          index = oy.buffer(BUFSIZE);
          buffer = oy.data;
          bytes = readStream(buffer,index,BUFSIZE);
          if (bytes == -1)
          {
            break;
          }
          oy.wrote(bytes);
          if (bytes == 0) ALWAYS FALSE
            eos = 1;
        }
      }

Regards,
Chris


Iceuse - Kris wrote:

> Hello,
>
> I found a fallback trouble on icecast 2.1kh4 (but it's the same with 
> 2.0 I think) :
>
> - ices streams live.ogg to icecast
> - icecast has a fallback live-default.ogg for live.ogg
>
> - a listener A listen at live.ogg
> - I shut down the source
> - the listener A is trying to read data from its connection, but 
> receives nothing. Sometimes, it gets fallback data, sometimes 
> nothing... (source timeout=10 sec, client timeout=10sec)
> - any new listener B coming after live.ogg shutdown get the content of 
> the fallback (thats good)
>
> - a new listener B connects to live.ogg and is hearing the fallback
> - I restart the source
> - live.ogg reconnects
> - the listener B listening at live.ogg (the fallback in fact) get no 
> data on reading data from its connection (any try to read data returns 
> zero bytes)
> - the listener A is still the same problem...
>
> It occurs with a java player (easy to debug and see whats happening) 
> and also with VLC.
> Sometimes, listener get the fallback data when source dies (more often 
> it gets nothing)
>
> I will change my java client to reconnect if it gets no data after 
> trying a few times to read. I think something can be done on icecast 
> side...
>
> Regards,
> Chris




More information about the Icecast-dev mailing list