[Live-devel] Problem with socket buffer or not ?

Ross Finlayson finlayson at live555.com
Wed Oct 18 15:29:24 PDT 2006


>while(1)
>{
>     event = 0;
>     readSource->getNextFrame( buffer, buffer_size, StreamRead, 
>state, StreamClose, state);
>     env->taskScheduler().doEventLoop(&(event));
>}
>...
>static void StreamRead(void *data, unsigned int i_size,
>                         unsigned int i_truncated_bytes, struct timeval pts,
>                         unsigned int duration)
>{   
>     env << i_size;
>     event = 0xff;
>}

This code is very strange, and might be the cause of your problems 
(although I'm not certain of this).  Note that you don't need to call 
"doEventLoop()" within a loop, because it already *is* a loop. 
Instead, restructure your code as:

readSource->getNextFrame( buffer, buffer_size, StreamRead, state, 
StreamClose, state);
doEventLoop();
...
static void StreamRead(void *data, unsigned int i_size,
                         unsigned int i_truncated_bytes, struct timeval pts,
                         unsigned int duration)
{   
     env << i_size;
     readSource->getNextFrame( buffer, buffer_size, StreamRead, state, 
StreamClose, state);
}
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list