[vlc-devel] [PATCH] demux: adaptive: fix inverted logic and don't do wait in a loop

Rémi Denis-Courmont remi at remlab.net
Wed Jul 26 16:38:31 CEST 2017


Le keskiviikkona 26. heinäkuuta 2017, 19.43.34 EEST Zhao Zhili a écrit :
> ---
>  modules/demux/adaptive/PlaylistManager.cpp | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/modules/demux/adaptive/PlaylistManager.cpp
> b/modules/demux/adaptive/PlaylistManager.cpp
> index f560d0f..f489a18f 100644
> --- a/modules/demux/adaptive/PlaylistManager.cpp
> +++ b/modules/demux/adaptive/PlaylistManager.cpp
> @@ -664,8 +664,7 @@ void PlaylistManager::Run()
>              vlc_mutex_unlock(&demux.lock);
> 
>              mutex_cleanup_push(&lock);
> -            while(vlc_cond_timedwait(&waitcond, &lock, i_deadline) == 0
> -                 && i_deadline < mdate());
> +            vlc_cond_timedwait(&waitcond, &lock, i_deadline);
>              vlc_cleanup_pop();
>          }
>      }

The existing code is an obtuse and inefficient emulation of mwait(). It does 
not make much sense. But the patch is also wrong due to spurious wake-ups.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list