[vlc-commits] vout: interlacing: move struct into vout_internal.h

Thomas Guillem git at videolan.org
Mon Apr 10 16:33:45 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Apr 10 16:10:05 2017 +0200| [1983e0b93555eca0f2d608b94b961f723ac689a3] | committer: Thomas Guillem

vout: interlacing: move struct into vout_internal.h

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

 src/video_output/interlacing.c   | 21 ++++++++++++++-------
 src/video_output/interlacing.h   |  7 +------
 src/video_output/video_output.c  |  7 +------
 src/video_output/vout_internal.h |  5 +++++
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/video_output/interlacing.c b/src/video_output/interlacing.c
index aa83b0cab6..c68068028d 100644
--- a/src/video_output/interlacing.c
+++ b/src/video_output/interlacing.c
@@ -30,6 +30,7 @@
 #include <vlc_vout.h>
 
 #include "interlacing.h"
+#include "vout_internal.h"
 
 /*****************************************************************************
  * Deinterlacing
@@ -230,22 +231,28 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
 
     var_SetInteger(vout, "deinterlace", deinterlace_state);
     free(deinterlace_mode);
+
+    vout->p->interlacing.is_interlaced = is_interlaced;
+    if (is_interlaced)
+        vout->p->interlacing.date = mdate();
 }
 
-void vout_SetInterlacingState(vout_thread_t *vout, vout_interlacing_support_t *state, bool is_interlaced)
+void vout_SetInterlacingState(vout_thread_t *vout, bool is_interlaced)
 {
      /* Wait 30s before quiting interlacing mode */
-    const int interlacing_change = (!!is_interlaced) - (!!state->is_interlaced);
-    if ((interlacing_change == 1) ||
-        (interlacing_change == -1 && state->date + 30000000 < mdate())) {
+    const int interlacing_change = (!!is_interlaced)
+                                 - (!!vout->p->interlacing.is_interlaced);
+    if (interlacing_change == 1 ||
+        (interlacing_change == -1 &&
+        vout->p->interlacing.date + 30000000 < mdate()))
+    {
         msg_Dbg(vout, "Detected %s video",
                  is_interlaced ? "interlaced" : "progressive");
         var_SetBool(vout, "deinterlace-needed", is_interlaced);
-
-        state->is_interlaced = is_interlaced;
+        vout->p->interlacing.is_interlaced = is_interlaced;
     }
     if (is_interlaced)
-        state->date = mdate();
+        vout->p->interlacing.date = mdate();
 }
 
 
diff --git a/src/video_output/interlacing.h b/src/video_output/interlacing.h
index 89c7f3e468..9c6e04f616 100644
--- a/src/video_output/interlacing.h
+++ b/src/video_output/interlacing.h
@@ -24,12 +24,7 @@
 #ifndef LIBVLC_VOUT_INTERLACING_H
 #define LIBVLC_VOUT_INTERLACING_H
 
-typedef struct {
-    bool    is_interlaced;
-    mtime_t date;
-} vout_interlacing_support_t;
-
 void vout_InitInterlacingSupport(vout_thread_t *, bool is_interlaced);
-void vout_SetInterlacingState(vout_thread_t *, vout_interlacing_support_t *, bool is_interlaced);
+void vout_SetInterlacingState(vout_thread_t *, bool is_interlaced);
 
 #endif
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 4ba5640605..e752355f30 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1627,11 +1627,6 @@ static void *Thread(void *object)
     vout_thread_t *vout = object;
     vout_thread_sys_t *sys = vout->p;
 
-    vout_interlacing_support_t interlacing = {
-        .is_interlaced = false,
-        .date = mdate(),
-    };
-
     mtime_t deadline = VLC_TS_INVALID;
     bool wait = false;
     for (;;) {
@@ -1653,7 +1648,7 @@ static void *Thread(void *object)
 
         const bool picture_interlaced = sys->displayed.is_interlaced;
 
-        vout_SetInterlacingState(vout, &interlacing, picture_interlaced);
+        vout_SetInterlacingState(vout, picture_interlaced);
         vout_ManageWrapper(vout);
     }
 }
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index fec54f38eb..c7d33bafb6 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -109,6 +109,11 @@ struct vout_thread_sys_t
         int         position;
     } title;
 
+    struct {
+        bool        is_interlaced;
+        mtime_t     date;
+    } interlacing;
+
     /* */
     bool            is_late_dropped;
 



More information about the vlc-commits mailing list