summaryrefslogtreecommitdiff
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-30 12:42:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-30 12:43:58 +0200
commit97cebf3139ccb0988927657cf16c3ca9c75996c6 (patch)
tree37a099401d3dd232196b9790c52891e3b77225fe /libavformat/udp.c
parent19bf1ed1f4263346ec67b7a8271b9b6351c8a011 (diff)
avformat/udp: Move variables used only with HAVE_PTHREAD_CANCEL, under the #if
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c
index e87cd140ba..376a544e95 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -784,9 +784,9 @@ static int udp_read(URLContext *h, uint8_t *buf, int size)
{
UDPContext *s = h->priv_data;
int ret;
+#if HAVE_PTHREAD_CANCEL
int avail, nonblock = h->flags & AVIO_FLAG_NONBLOCK;
-#if HAVE_PTHREAD_CANCEL
if (s->fifo) {
pthread_mutex_lock(&s->mutex);
do {
@@ -863,13 +863,13 @@ static int udp_write(URLContext *h, const uint8_t *buf, int size)
static int udp_close(URLContext *h)
{
UDPContext *s = h->priv_data;
- int ret;
if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr,(struct sockaddr *)&s->local_addr_storage);
closesocket(s->udp_fd);
#if HAVE_PTHREAD_CANCEL
if (s->thread_started) {
+ int ret;
pthread_cancel(s->circular_buffer_thread);
ret = pthread_join(s->circular_buffer_thread, NULL);
if (ret != 0)