aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorEric Petit <eric@lapsus.org>2012-06-27 15:09:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-27 22:50:22 +0200
commitf1136b2b10b3c4400944db5fa5ce56ab38a09bb4 (patch)
tree5eedaf5ee40fe78f9f845e27884dabbacf8f419a /libavformat/udp.c
parent54942c238356f1e4c6fcce04b67f216dafd819c5 (diff)
downloadffmpeg-f1136b2b10b3c4400944db5fa5ce56ab38a09bb4.tar.gz
udp: fix occasional crash on shutdown
Wait until the thread is down before destroying the fifo Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/udp.c b/libavformat/udp.c
index e8493b5df2..396cf85ea0 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -656,7 +656,6 @@ static int udp_close(URLContext *h)
if (s->is_multicast && (h->flags & AVIO_FLAG_READ))
udp_leave_multicast_group(s->udp_fd, (struct sockaddr *)&s->dest_addr);
closesocket(s->udp_fd);
- av_fifo_free(s->fifo);
#if HAVE_PTHREAD_CANCEL
if (s->thread_started) {
pthread_cancel(s->circular_buffer_thread);
@@ -668,6 +667,7 @@ static int udp_close(URLContext *h)
pthread_mutex_destroy(&s->mutex);
pthread_cond_destroy(&s->cond);
#endif
+ av_fifo_free(s->fifo);
return 0;
}