diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-03-15 13:11:06 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-03-22 17:36:23 +0100 |
commit | 5deb5ccbbb556c4a15f3c7494f00de2963d0aba6 (patch) | |
tree | deea4b21357f63dce2745ec6c7c47edae93f05a4 /libavformat/udp.c | |
parent | 63afc4f6384c4e3b37173e52782cc110406f573f (diff) | |
download | ffmpeg-5deb5ccbbb556c4a15f3c7494f00de2963d0aba6.tar.gz |
udp: call av_fifo_space directly as needed.
The comment seemed to indicate that left was used
to limit the size of the recv, but it was not so.
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r-- | libavformat/udp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c index dad79ffc41..4a6cee2d29 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -332,13 +332,8 @@ static void *circular_buffer_task( void *_URLContext) pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate); ff_socket_nonblock(s->udp_fd, 0); while(1) { - int left; int len; - /* How much do we have left to the end of the buffer */ - /* Whats the minimum we can read so that we dont comletely fill the buffer */ - left = av_fifo_space(s->fifo); - /* Blocking operations are always cancellation points; see "General Information" / "Thread Cancelation Overview" in Single Unix. */ @@ -353,7 +348,8 @@ static void *circular_buffer_task( void *_URLContext) continue; } AV_WL32(s->tmp, len); - if(left < len + 4) { + + if(av_fifo_space(s->fifo) < len + 4) { /* No Space left */ if (s->overrun_nonfatal) { av_log(h, AV_LOG_WARNING, "Circular buffer overrun. " |