diff options
author | Marton Balint <cus@passwd.hu> | 2020-01-14 18:53:45 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2020-01-25 23:16:47 +0100 |
commit | 67f39b32db2b68eabcc51519a2430687439f1cf5 (patch) | |
tree | 049a82e5fb36d6c8c18011fa964b7e4728403cb1 /libavformat/udp.c | |
parent | f61e9f8aef3a13fe976c241f828fca4222d8e922 (diff) |
avformat/udp: properly use return value of pthread_cond_timedwait
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r-- | libavformat/udp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c index f5f636e1af..7e59d51cc6 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -978,9 +978,10 @@ static int udp_read(URLContext *h, uint8_t *buf, int size) int64_t t = av_gettime() + 100000; struct timespec tv = { .tv_sec = t / 1000000, .tv_nsec = (t % 1000000) * 1000 }; - if (pthread_cond_timedwait(&s->cond, &s->mutex, &tv) < 0) { + int err = pthread_cond_timedwait(&s->cond, &s->mutex, &tv); + if (err) { pthread_mutex_unlock(&s->mutex); - return AVERROR(errno == ETIMEDOUT ? EAGAIN : errno); + return AVERROR(err == ETIMEDOUT ? EAGAIN : err); } nonblock = 1; } |