aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-23 01:51:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 22:26:26 +0100
commit33636442e2f44c2dcffd4331085ae7de93f0abe0 (patch)
tree9a4b238b6a8f55fca13c66f9d4221bc1c82139fe
parent3710f0b9edd7cf69a83ed00d2e33630b7188187f (diff)
downloadffmpeg-33636442e2f44c2dcffd4331085ae7de93f0abe0.tar.gz
udp: support non blocking reads with fifo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 9f50dafe9025555f11e66e3b09cf3db2cd53cfb2) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/udp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 040cf90fa3..b9ebf4153a 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);