[vlc-commits] rtp: remove constant thread_ready flag

Rémi Denis-Courmont git at videolan.org
Sat Jun 6 08:07:51 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 26 15:54:38 2020 +0300| [6ef6e5c6754e7bd4efb8437a3b11f4b1b257b375] | committer: Rémi Denis-Courmont

rtp: remove constant thread_ready flag

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

 modules/access/rtp/rtp.c | 13 ++-----------
 modules/access/rtp/rtp.h |  1 -
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/modules/access/rtp/rtp.c b/modules/access/rtp/rtp.c
index 04f3f3f65c..b3e9762175 100644
--- a/modules/access/rtp/rtp.c
+++ b/modules/access/rtp/rtp.c
@@ -141,12 +141,8 @@ static void Close (vlc_object_t *obj)
     demux_t *demux = (demux_t *)obj;
     demux_sys_t *p_sys = demux->p_sys;
 
-    if (p_sys->thread_ready)
-    {
-        vlc_cancel (p_sys->thread);
-        vlc_join (p_sys->thread, NULL);
-    }
-
+    vlc_cancel(p_sys->thread);
+    vlc_join(p_sys->thread, NULL);
 #ifdef HAVE_SRTP
     if (p_sys->srtp)
         srtp_destroy (p_sys->srtp);
@@ -190,7 +186,6 @@ static int OpenSDP(vlc_object_t *obj)
 #ifdef HAVE_SRTP
     sys->srtp = NULL;
 #endif
-    sys->thread_ready = false;
 
     struct vlc_sdp *sdp = vlc_sdp_parse((const char *)peek, sdplen);
     if (sdp == NULL) {
@@ -322,8 +317,6 @@ static int OpenSDP(vlc_object_t *obj)
         rtp_session_destroy(demux, sys->session);
         goto error;
     }
-
-    sys->thread_ready = true;
     return VLC_SUCCESS;
 
 error:
@@ -447,7 +440,6 @@ static int OpenURL(vlc_object_t *obj)
     p_sys->timeout      = vlc_tick_from_sec( var_CreateGetInteger (obj, "rtp-timeout") );
     p_sys->max_dropout  = var_CreateGetInteger (obj, "rtp-max-dropout");
     p_sys->max_misorder = var_CreateGetInteger (obj, "rtp-max-misorder");
-    p_sys->thread_ready = false;
     p_sys->autodetect   = true;
 
     demux->pf_demux   = NULL;
@@ -487,7 +479,6 @@ static int OpenURL(vlc_object_t *obj)
     if (vlc_clone (&p_sys->thread, rtp_dgram_thread,
                    demux, VLC_THREAD_PRIORITY_INPUT))
         goto error;
-    p_sys->thread_ready = true;
     return VLC_SUCCESS;
 
 error:
diff --git a/modules/access/rtp/rtp.h b/modules/access/rtp/rtp.h
index 84f78bc2fe..383d5caf49 100644
--- a/modules/access/rtp/rtp.h
+++ b/modules/access/rtp/rtp.h
@@ -75,7 +75,6 @@ typedef struct
     uint16_t      max_dropout; /**< Max packet forward misordering */
     uint16_t      max_misorder; /**< Max packet backward misordering */
     uint8_t       max_src; /**< Max simultaneous RTP sources */
-    bool          thread_ready;
     bool          autodetect; /**< Payload type autodetection pending */
 } demux_sys_t;
 



More information about the vlc-commits mailing list