[vlc-commits] video_output: simplify setting a new deinterlace mode

Steve Lhomme git at videolan.org
Tue Sep 3 10:12:14 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Aug 27 10:01:50 2019 +0200| [1afedd4d75e798bf31cadcbb6c642005980df1f7] | committer: Steve Lhomme

video_output: simplify setting a new deinterlace mode

Don't pass a value if we don't want to change it.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1afedd4d75e798bf31cadcbb6c642005980df1f7
---

 src/video_output/video_output.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 468ed533d4..d9c81e92a8 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -744,7 +744,7 @@ typedef struct {
 static void ThreadChangeFilters(vout_thread_t *vout,
                                 const video_format_t *source,
                                 const char *filters,
-                                int deinterlace,
+                                const bool *new_deinterlace,
                                 bool is_locked)
 {
     ThreadFilterFlush(vout, is_locked);
@@ -756,8 +756,8 @@ static void ThreadChangeFilters(vout_thread_t *vout,
     vlc_array_init(&array_static);
     vlc_array_init(&array_interactive);
 
-    vout->p->filter.has_deint =
-         deinterlace == 1 || (deinterlace == -1 && vout->p->filter.has_deint);
+    if (new_deinterlace != NULL)
+        vout->p->filter.has_deint = *new_deinterlace;
 
     if (vout->p->filter.has_deint)
     {
@@ -903,7 +903,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, -1, true);
+                    ThreadChangeFilters(vout, &decoded->format, vout->p->filter.configuration, NULL, true);
             }
         }
 
@@ -1573,11 +1573,11 @@ static void ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
         ThreadChangeFilters(vout, NULL,
                             cmd.string != NULL ?
                             cmd.string : vout->p->filter.configuration,
-                            -1, false);
+                            NULL, false);
         break;
     case VOUT_CONTROL_CHANGE_INTERLACE:
         ThreadChangeFilters(vout, NULL, vout->p->filter.configuration,
-                            cmd.boolean ? 1 : 0, false);
+                            &cmd.boolean, false);
         break;
     case VOUT_CONTROL_MOUSE_STATE:
         ThreadProcessMouseState(vout, &cmd.mouse);



More information about the vlc-commits mailing list