[vlc-devel] [PATCH v2 03/13] video_output: remove always true boolean from ThreadChangeFilters

Steve Lhomme robux4 at ycbcr.xyz
Mon Aug 17 15:15:22 CEST 2020


We always call this function under filter lock.
---
 src/video_output/video_output.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 778fdc99ae7..f3f7197cf3f 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -929,11 +929,10 @@ typedef struct {
 
 static void ThreadChangeFilters(vout_thread_sys_t *vout,
                                 const char *filters,
-                                const bool *new_deinterlace,
-                                bool is_locked)
+                                const bool *new_deinterlace)
 {
     vout_thread_sys_t *sys = vout;
-    ThreadFilterFlush(vout, is_locked);
+    ThreadFilterFlush(vout, true);
     ThreadDelAllFilterCallbacks(vout);
 
     vlc_array_t array_static;
@@ -988,9 +987,6 @@ static void ThreadChangeFilters(vout_thread_sys_t *vout,
         current = next;
     }
 
-    if (!is_locked)
-        vlc_mutex_lock(&sys->filter.lock);
-
     es_format_t fmt_target;
     es_format_InitFromVideo(&fmt_target, &sys->filter.src_fmt);
     vlc_video_context *vctx_target  = sys->filter.src_vctx;
@@ -1046,9 +1042,6 @@ static void ThreadChangeFilters(vout_thread_sys_t *vout,
         free(sys->filter.configuration);
         sys->filter.configuration = filters ? strdup(filters) : NULL;
     }
-
-    if (!is_locked)
-        vlc_mutex_unlock(&sys->filter.lock);
 }
 
 
@@ -1116,7 +1109,7 @@ static int ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reuse,
                         vlc_video_context_Release(sys->filter.src_vctx);
                     sys->filter.src_vctx = pic_vctx ? vlc_video_context_Hold(pic_vctx) : NULL;
 
-                    ThreadChangeFilters(vout, NULL, NULL, true);
+                    ThreadChangeFilters(vout, NULL, NULL);
                 }
             }
         }
@@ -1465,7 +1458,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     vlc_mutex_lock(&sys->filter.lock);
     if (sys->filter.filters_changed ||
         sys->filter.new_interlaced != sys->private.interlacing.has_deint)
-        ThreadChangeFilters(vout, sys->filter.new_filters, &sys->filter.new_interlaced, true);
+        ThreadChangeFilters(vout, sys->filter.new_filters, &sys->filter.new_interlaced);
     vlc_mutex_unlock(&sys->filter.lock);
 
     if (first)
-- 
2.26.2



More information about the vlc-devel mailing list