[FFmpeg-cvslog] udp: support non blocking reads with fifo

Michael Niedermayer git at videolan.org
Fri Dec 23 02:03:05 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 23 01:51:47 2011 +0100| [9f50dafe9025555f11e66e3b09cf3db2cd53cfb2] | committer: Michael Niedermayer

udp: support non blocking reads with fifo

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f50dafe9025555f11e66e3b09cf3db2cd53cfb2
---

 libavformat/udp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index d360bd6..5bf7d82 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -572,6 +572,9 @@ static int udp_read(URLContext *h, uint8_t *buf, int size)
             } else if(s->circular_buffer_error){
                 pthread_mutex_unlock(&s->mutex);
                 return s->circular_buffer_error;
+            } else if(h->flags & AVIO_FLAG_NONBLOCK) {
+                pthread_mutex_unlock(&s->mutex);
+                return AVERROR(EAGAIN);
             }
             else {
                 pthread_cond_wait(&s->cond, &s->mutex);



More information about the ffmpeg-cvslog mailing list