<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 31, 2017 at 10:06 PM, Francois Cartegnie <span dir="ltr"><<a href="mailto:fcvlcdev@free.fr" target="_blank">fcvlcdev@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Le 28/07/2017 à 10:49, Zhao Zhili a écrit :<br>
> @@ -614,8 +614,7 @@ void PlaylistManager::<wbr>setBufferingRunState(bool b)<br>
>  {<br>
>      vlc_mutex_lock(&lock);<br>
>      b_buffering = b;<br>
> -    if(b_buffering)<br>
> -        vlc_cond_signal(&waitcond);<br>
> +    vlc_cond_signal(&waitcond);<br>
>      vlc_mutex_unlock(&lock);<br>
>  }<br>
><br>
> @@ -665,8 +664,9 @@ void PlaylistManager::Run()<br>
>              vlc_mutex_unlock(&demux.lock);<br>
><br>
>              mutex_cleanup_push(&lock);<br>
> -            while(vlc_cond_timedwait(&<wbr>waitcond, &lock, i_deadline) == 0<br>
> -                 && i_deadline < mdate());<br>
> +            while(b_buffering &&<br>
> +                    vlc_cond_timedwait(&waitcond, &lock, i_deadline) == 0<br>
> &&<br>
> +                    i_deadline > mdate());<br>
>              vlc_cleanup_pop();<br>
>          }<br>
>      }<br>
<br>
<br>
</span>I don't know what you're trying to do but that's not going to work.<br>
The b_buffering is a buffering thread disable switch.<br>
<br>
If you trigger signal when disabling, you'll run the bufferize() and<br>
break any seek because it did not stop.<br>
<br></blockquote><div><br></div><div>There are two point where setBufferingRunState() can get the lock and call vlc_cond_signal():<br><br></div><div>Case 1. <br></div><div>        while(!b_buffering)<br>            vlc_cond_wait(&waitcond, &lock);<br><br></div><div>Case 2.<br><span class="gmail-">> +            while(b_buffering &&<br>
> +                    vlc_cond_timedwait(&waitcond, &lock, i_deadline) == 0<br>
> &&<br>
> +                    i_deadline > mdate());</span><br><br></div><div>For the first case, signal when disabling won't do much other than wakeup and wait again.<br><br></div><div>For the second case, signal when disabling will break the loop and step into the first case.<br></div><div>Bufferize() won't get the chance to run.<br><br></div><div>Breakout the second case and step into the first case has a positive effect since the first while loop<br></div><div>response to setBufferingRunState(true) quickly. The second while loop doesn't breakout for<br>setBufferingRunState(true), which is not desirable.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Francois<br>
______________________________<wbr>_________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/<wbr>listinfo/vlc-devel</a></blockquote></div><br></div></div>