[vlc-devel] [PATCH] too long timeouts in win32 vlc_poll
Rafaël Carré
funman at videolan.org
Sun Feb 3 13:09:21 CET 2013
Le 03/02/2013 12:01, Mario Speiß a écrit :
> When vlc_poll is called with timeout of i.e. 5000ms it may happen that the
> waiting time might be as long as 2500s ! Probably poll should be called with
> the 50ms timeout as many times until the original provided timeout has been
> reached.
>
> Regards,
> Mario
> ---
> include/vlc_threads.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/vlc_threads.h b/include/vlc_threads.h
> index 7c6a4ca..337ded4 100644
> --- a/include/vlc_threads.h
> +++ b/include/vlc_threads.h
> @@ -392,7 +392,7 @@ static inline int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
>
> while (timeout > 50)
> {
> - int val = poll (fds, nfds, timeout);
> + int val = poll (fds, nfds, 50);
> if (val != 0)
> return val;
> timeout -= 50;
>
I think the problem is that if timeout is very long, the thread can not
be cancelled before that full timeout has been spent in poll()
More information about the vlc-devel
mailing list