<html><head></head><body>Hi,<br><br>You could change vlc_thread_t to a pointer type on all platforms.<br><br>You could even make vlc_join(NULL, ...) a no-op to simplify error paths.<br><br>But this requires changing some of the platform code first.<br><br><div class="gmail_quote">Le 11 février 2020 11:01:05 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">We already have a variable to store it.<hr> modules/demux/adaptive/PlaylistManager.cpp | 18 ++++++++++--------<br> modules/demux/adaptive/PlaylistManager.h | 1 -<br> 2 files changed, 10 insertions(+), 9 deletions(-)<br><br>diff --git a/modules/demux/adaptive/PlaylistManager.cpp b/modules/demux/adaptive/PlaylistManager.cpp<br>index a8bce7aca19..62c697e1432 100644<br>--- a/modules/demux/adaptive/PlaylistManager.cpp<br>+++ b/modules/demux/adaptive/PlaylistManager.cpp<br>@@ -62,7 +62,7 @@ PlaylistManager::PlaylistManager( demux_t *p_demux_,<br> currentPeriod = playlist->getFirstPeriod();<br> resources = res;<br> failedupdates = 0;<br>- b_thread = false;<br>+ thread = nullptr;<br> b_buffering = false;<br> b_canceled = false;<br> nextPlaylistupdate = 0;<br>@@ -159,13 +159,15 @@ bool PlaylistManager::init()<br> <br> bool PlaylistManager::start()<br> {<br>- if(b_thread)<br>+ if (thread != nullptr)<br> return false;<br> <br>- b_thread = !vlc_clone(&thread, managerThread,<br>- static_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT);<br>- if(!b_thread)<br>+ if (!vlc_clone(&thread, managerThread,<br>+ static_cast<void *>(this), VLC_THREAD_PRIORITY_INPUT))<br>+ {<br>+ thread = nullptr;<br> return false;<br>+ }<br> <br> setBufferingRunState(true);<br> <br>@@ -174,12 +176,12 @@ bool PlaylistManager::start()<br> <br> bool PlaylistManager::started() const<br> {<br>- return b_thread;<br>+ return thread != nullptr;<br> }<br> <br> void PlaylistManager::stop()<br> {<br>- if(b_thread)<br>+ if(thread != nullptr)<br> {<br> vlc_mutex_lock(&lock);<br> b_canceled = true;<br>@@ -187,7 +189,7 @@ void PlaylistManager::stop()<br> vlc_mutex_unlock(&lock);<br> <br> vlc_join(thread, NULL);<br>- b_thread = false;<br>+ thread = nullptr;<br> }<br> }<br> <br>diff --git a/modules/demux/adaptive/PlaylistManager.h b/modules/demux/adaptive/PlaylistManager.h<br>index 55ceacde7c9..501200f9b7a 100644<br>--- a/modules/demux/adaptive/PlaylistManager.h<br>+++ b/modules/demux/adaptive/PlaylistManager.h<br>@@ -132,7 +132,6 @@ namespace adaptive<br> static void * managerThread(void *);<br> vlc_mutex_t lock;<br> vlc_thread_t thread;<br>- bool b_thread;<br> vlc_cond_t waitcond;<br> bool b_buffering;<br> bool b_canceled;</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>