[vlc-devel] [PATCH 2/2] video_output: pass NULL to ThreadChangeFilters() when user filters don't change

Steve Lhomme robux4 at ycbcr.xyz
Mon Sep 2 15:49:42 CEST 2019


---
 src/video_output/video_output.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index a3a3ce060a..309df56b8a 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -770,6 +770,7 @@ static void ThreadChangeFilters(vout_thread_t *vout,
         }
     }
 
+    if (filters == NULL) filters = vout->p->filter.configuration;
     char *current = filters ? strdup(filters) : NULL;
     while (current) {
         config_chain_t *cfg;
@@ -903,7 +904,7 @@ static int ThreadDisplayPreparePicture(vout_thread_t *vout, bool reuse, bool fra
                     }
                 }
                 if (!VideoFormatIsCropArEqual(&decoded->format, &vout->p->filter.format))
-                    ThreadChangeFilters(vout, &decoded->format, vout->p->filter.configuration, NULL, true);
+                    ThreadChangeFilters(vout, &decoded->format, NULL, NULL, true);
             }
         }
 
@@ -1570,14 +1571,10 @@ static void ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
 {
     switch(cmd.type) {
     case VOUT_CONTROL_CHANGE_FILTERS:
-        ThreadChangeFilters(vout, NULL,
-                            cmd.string != NULL ?
-                            cmd.string : vout->p->filter.configuration,
-                            NULL, false);
+        ThreadChangeFilters(vout, NULL, cmd.string, NULL, false);
         break;
     case VOUT_CONTROL_CHANGE_INTERLACE:
-        ThreadChangeFilters(vout, NULL, vout->p->filter.configuration,
-                            &cmd.boolean, false);
+        ThreadChangeFilters(vout, NULL, NULL, &cmd.boolean, false);
         break;
     case VOUT_CONTROL_MOUSE_STATE:
         ThreadProcessMouseState(vout, &cmd.mouse);
-- 
2.17.1



More information about the vlc-devel mailing list