}
static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr,
- int *addr_len, const char *localaddr)
+ socklen_t *addr_len, const char *localaddr)
{
int udp_fd = -1;
struct addrinfo *res0 = NULL, *res = NULL;
const char *p;
char buf[256];
struct sockaddr_storage my_addr;
- int len;
+ socklen_t len;
int reuse_specified = 0;
int i, include = 0, num_sources = 0;
char *sources[32];
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);