[FFmpeg-cvslog] udp: fix occasional crash on shutdown

Eric Petit git at videolan.org
Wed Jun 27 23:02:54 CEST 2012


ffmpeg | branch: master | Eric Petit <eric at lapsus.org> | Wed Jun 27 15:09:40 2012 +0200| [f1136b2b10b3c4400944db5fa5ce56ab38a09bb4] | committer: Michael Niedermayer

udp: fix occasional crash on shutdown

Wait until the thread is down before destroying the fifo

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1136b2b10b3c4400944db5fa5ce56ab38a09bb4
---

 libavformat/udp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index e8493b5..396cf85 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;
 }
 



More information about the ffmpeg-cvslog mailing list