[vlc-devel] [PATCH] demux: adaptive: signal buffering state change in both cases
Francois Cartegnie
fcvlcdev at free.fr
Mon Jul 31 16:06:06 CEST 2017
Le 28/07/2017 à 10:49, Zhao Zhili a écrit :
> @@ -614,8 +614,7 @@ void PlaylistManager::setBufferingRunState(bool b)
> {
> vlc_mutex_lock(&lock);
> b_buffering = b;
> - if(b_buffering)
> - vlc_cond_signal(&waitcond);
> + vlc_cond_signal(&waitcond);
> vlc_mutex_unlock(&lock);
> }
>
> @@ -665,8 +664,9 @@ void PlaylistManager::Run()
> vlc_mutex_unlock(&demux.lock);
>
> mutex_cleanup_push(&lock);
> - while(vlc_cond_timedwait(&waitcond, &lock, i_deadline) == 0
> - && i_deadline < mdate());
> + while(b_buffering &&
> + vlc_cond_timedwait(&waitcond, &lock, i_deadline) == 0
> &&
> + i_deadline > mdate());
> vlc_cleanup_pop();
> }
> }
I don't know what you're trying to do but that's not going to work.
The b_buffering is a buffering thread disable switch.
If you trigger signal when disabling, you'll run the bufferize() and
break any seek because it did not stop.
Francois
More information about the vlc-devel
mailing list