[vlc-commits] satip: fix vlc_thread_t usage

Rémi Denis-Courmont git at videolan.org
Mon Jul 25 20:51:32 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 25 21:49:13 2016 +0300| [3950d70d66b3ed3c72202f5876bf4bdb53812473] | committer: Rémi Denis-Courmont

satip: fix vlc_thread_t usage

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3950d70d66b3ed3c72202f5876bf4bdb53812473
---

 modules/access/satip.c | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/modules/access/satip.c b/modules/access/satip.c
index f5034ca..f07f117 100644
--- a/modules/access/satip.c
+++ b/modules/access/satip.c
@@ -754,21 +754,7 @@ static int satip_open(vlc_object_t *obj)
 
 error:
     free(psz_lower_url);
-
     vlc_UrlClean(&url);
-    satip_close(access);
-    return VLC_EGENERIC;
-}
-
-static void satip_close(vlc_object_t *obj)
-{
-    access_t *access = (access_t *)obj;
-    access_sys_t *sys = access->p_sys;
-
-    if (sys->thread) {
-        vlc_cancel(sys->thread);
-        vlc_join(sys->thread, NULL);
-    }
 
     satip_teardown(access);
 
@@ -784,4 +770,24 @@ static void satip_close(vlc_object_t *obj)
     free(sys->content_base);
     free(sys->control);
     free(sys);
+    return VLC_EGENERIC;
+}
+
+static void satip_close(vlc_object_t *obj)
+{
+    access_t *access = (access_t *)obj;
+    access_sys_t *sys = access->p_sys;
+
+    vlc_cancel(sys->thread);
+    vlc_join(sys->thread, NULL);
+
+    satip_teardown(access);
+
+    block_FifoRelease(sys->fifo);
+    net_Close(sys->udp_sock);
+    net_Close(sys->rtcp_sock);
+    net_Close(sys->tcp_sock);
+    free(sys->content_base);
+    free(sys->control);
+    free(sys);
 }



More information about the vlc-commits mailing list