Browse Source

avformat/udp: Move variables used only with HAVE_PTHREAD_CANCEL, under the #if

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4
Michael Niedermayer 10 years ago
parent
commit
97cebf3139
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/udp.c

+ 2
- 2
libavformat/udp.c View File

@@ -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)


Loading…
Cancel
Save