[vlc-devel] [PATCH] es_out_timeshift: fix inverted logic

Zhao Zhili quinkblack at foxmail.com
Mon Sep 10 09:13:17 CEST 2018


On 2018年09月08日 18:41, Zhao Zhili wrote:
> A test case:
> vlc -vv --rate 0.5 ~/.local/share/vlc/ml.xspf
> es_out_GetEmpty return false forever
The content of ml.xspf
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" 
xmlns:vlc="http://www.videolan.org/vlc/playlist/ns/0/" version="1">
         <title>Media Library</title>
         <trackList>
         </trackList>
         <extension application="http://www.videolan.org/vlc/playlist/0">
         </extension>
</playlist>

Looks like it's a regression introduced in 55025f16

  static bool TsHasCmd( ts_thread_t *p_ts )
@@ -724,7 +778,7 @@ static bool TsHasCmd( ts_thread_t *p_ts )
      bool b_cmd;

      vlc_mutex_lock( &p_ts->lock );
-    b_cmd =  p_ts->i_cmd > 0;
+    b_cmd =  TsStorageIsEmpty( p_ts->p_storage_r );
      vlc_mutex_unlock( &p_ts->lock );

      return b_cmd;
@@ -736,7 +790,7 @@ static bool TsIsUnused( ts_thread_t *p_ts )
      vlc_mutex_lock( &p_ts->lock );
      b_unused = !p_ts->b_paused &&
                 p_ts->i_rate == p_ts->i_rate_source &&
-               p_ts->i_cmd <= 0;
+               TsStorageIsEmpty( p_ts->p_storage_r );
      vlc_mutex_unlock( &p_ts->lock );

      return b_unused;

> ---
>   src/input/es_out_timeshift.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
> index 245abefb24..b7440da467 100644
> --- a/src/input/es_out_timeshift.c
> +++ b/src/input/es_out_timeshift.c
> @@ -922,7 +922,7 @@ static bool TsHasCmd( ts_thread_t *p_ts )
>       bool b_cmd;
>   
>       vlc_mutex_lock( &p_ts->lock );
> -    b_cmd =  TsStorageIsEmpty( p_ts->p_storage_r );
> +    b_cmd = !TsStorageIsEmpty( p_ts->p_storage_r );
>       vlc_mutex_unlock( &p_ts->lock );
>   
>       return b_cmd;





More information about the vlc-devel mailing list