提交 9f50dafe 编写于 作者: M Michael Niedermayer

udp: support non blocking reads with fifo

Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 bc900501
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册