[Ffmpeg-devel] FFServer and RTSP

Luca Abeni lucabe72
Fri Apr 6 12:32:07 CEST 2007

Hi all,

On Thu, 2007-04-05 at 19:51 +0200, Luca Abeni wrote:
> The attached patch fixes this specific bug. After applying it, ffserver
> gives a correct response "200 OK", but it still does not work. I am
> investigating this second problem.
Ok, I might have found something... The "poll()" loop in ffserver.c
looks like this:
do {
    ret = poll(poll_table, poll_entry - poll_table, delay);
    if (ret < 0 && errno != EAGAIN && errno != EINTR)
        return -1;
} while (ret <= 0);
but this does not make sense to me.
If poll() times out, it will return 0... And the loop will poll again?
So, what's the point of using a timeout?
The while() condition used to be while (ret == -1), which looks
better... But commit 3340, which reads "ffserver fixes by (Koos Vriezen
<koos.vriezen at xs4all dot nl>)" changed "== -1" in "<= 0".

So, I would be tempted to change "ret <= 0" in "ret < 0" - and this
actually fixes RTP/RTSP!!! But I do not want to remove some "ffserver

Does anyone know what would I break by changing "<= 0" in "< 0"? I
already know what I would fix... ;-)


More information about the ffmpeg-devel mailing list