On 19/02/02 23:09, Likai Liu shaped the electrons to say:> Ricardo Galli wrote: > >By assigning a timestamp to each packet read from the source socket. I > > think the only sane way to do it. > > great idea. with this implementation, actually you can set a smaller > buffer size, but wait a longer time for recovery. once congestion is > clear, previous "missed" packets are thrown away, and new packets > continue to flow. that introduces skips but overall latency control is > better. i like your idea.I am trying it now, you can do it also at http://mcrg.uib.es:8000/live.ogg <p>It's configured with a prebuffering of 5 seconds, and a maxlag of 10 seconds. If a refbuf for a given client exceeds 10 seconds, and it's not a partial packets, it is silently discarded and removed. The "core" is shown below: if(abuf->timestamp > 0 && /* only if has timestamp */ client->pos == 0 && /* give a chance to partial packets */ abuf->timestamp < (now - maxlag) /* packet too delayed, discard */ ) { /* almost a no-op */ printf("DEBUG: discarding %d bytes from queue!!! LAG=%d MAXLAG=%d\n", bytes, now - abuf->timestamp, maxlag); } else { printf("DEBUG: sending %d bytes from queue...\n", bytes); sbytes = sock_write_bytes(client->con->sock, abuf->data[client->pos], bytes); <p><p> -- ricardo "I just stopped using Windows and now you tell me to use Mirrors?" - said Aunt Tillie, just before downloading 2.5.3 kernel. --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On 19/02/02 18:09, Likai Liu shaped the electrons to say:> >It's partially done in the patch I've sent you, completelly done in my > >current version... I can send you the second patch, you will save some > > work. > > how is the calculation being done? do you extract the bitrate from the > stream data, or do you use a different method? I'd advocate *that* > different method though. actually, what i mean is, since we have theBy assigning a timestamp to each packet read from the source socket. I think the only sane way to do it. BTW, congratulations to the developers, I am loving the code, clear, simple, concise, elegant. -- ricardo "I just stopped using Windows and now you tell me to use Mirrors?" - said Aunt Tillie, just before downloading 2.5.3 kernel. --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Ricardo Galli wrote:>By assigning a timestamp to each packet read from the source socket. I think >the only sane way to do it. >great idea. with this implementation, actually you can set a smaller buffer size, but wait a longer time for recovery. once congestion is clear, previous "missed" packets are thrown away, and new packets continue to flow. that introduces skips but overall latency control is better. i like your idea. liulk <p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.