Browse Source

udp: add missing mutex unlock

Fixes CID703688
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
044c0e62ea
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/udp.c

+ 3
- 1
libavformat/udp.c View File

@@ -766,8 +766,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)
if (pthread_cond_timedwait(&s->cond, &s->mutex, &tv) < 0) {
pthread_mutex_unlock(&s->mutex);
return AVERROR(errno == ETIMEDOUT ? EAGAIN : errno);
}
nonblock = 1;
}
} while( 1);


Loading…
Cancel
Save