diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-23 01:51:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-23 01:51:47 +0100 |
commit | 9f50dafe9025555f11e66e3b09cf3db2cd53cfb2 (patch) | |
tree | 37ff9853b475a68941a08323695fefeb22696d87 /libavformat | |
parent | bc900501e0e2002e40d2d0c87b5a98b913b2d1a2 (diff) | |
download | ffmpeg-9f50dafe9025555f11e66e3b09cf3db2cd53cfb2.tar.gz |
udp: support non blocking reads with fifo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/udp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c index d360bd6057..5bf7d82dad 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); |