[vlc-devel] [PATCH] prefetch: reading while paused is valable

Alexandre Janniaux ajanni at videolabs.io
Mon Nov 18 17:09:33 CET 2019


Hi,

There's probably a typo in the commit message, with
valable => valid.

Otherwise, is it a regression?

Regards,
--
Videolabs
Alexandre Janniaux

On Mon, Nov 18, 2019 at 03:00:49PM +0100, Thomas Guillem wrote:
> This commit remove the wrong error message and put back the thread to sleep at
> the end of the read.
> ---
>  modules/stream_filter/prefetch.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/modules/stream_filter/prefetch.c b/modules/stream_filter/prefetch.c
> index 2991c002bd2..7edb374e77e 100644
> --- a/modules/stream_filter/prefetch.c
> +++ b/modules/stream_filter/prefetch.c
> @@ -309,9 +309,11 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)
>          return buflen;
>
>      vlc_mutex_lock(&sys->lock);
> +    bool was_paused = sys->paused;
>      if (sys->paused)
>      {
> -        msg_Err(stream, "reading while paused (buggy demux?)");
> +        /* Reading while paused. Notify the thread to resume and put it back to
> +         * sleep once the read is complete. */
>          sys->paused = false;
>          vlc_cond_signal(&sys->wait_space);
>      }
> @@ -340,6 +342,7 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)
>
>      memcpy(buf, sys->buffer + offset, copy);
>      sys->stream_offset += copy;
> +    sys->paused = was_paused;
>      vlc_cond_signal(&sys->wait_space);
>      vlc_mutex_unlock(&sys->lock);
>      return copy;
> --
> 2.20.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list