[vlc-commits] vout: move the deinterlacing control call in video_output.c
Steve Lhomme
git at videolan.org
Fri Jul 17 08:18:11 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jul 16 11:28:34 2020 +0200| [1a53518fe1cb5e9dffbdf2b726a82464f3469fe9] | committer: Steve Lhomme
vout: move the deinterlacing control call in video_output.c
So that only video_output.c needs to know about its internal control.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1a53518fe1cb5e9dffbdf2b726a82464f3469fe9
---
src/video_output/interlacing.c | 7 +------
src/video_output/video_output.c | 6 ++++++
src/video_output/vout_internal.h | 1 +
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/video_output/interlacing.c b/src/video_output/interlacing.c
index 3192b3a9cf..01c87a80eb 100644
--- a/src/video_output/interlacing.c
+++ b/src/video_output/interlacing.c
@@ -82,12 +82,7 @@ static int DeinterlaceCallback(vlc_object_t *object, char const *cmd,
var_SetString(vout, "sout-deinterlace-mode", mode);
msg_Dbg(vout, "deinterlace %d, mode %s, is_needed %d", deinterlace_state, mode, is_needed);
- if (deinterlace_state == 0 || (deinterlace_state < 0 && !is_needed))
- vout_control_PushBool(&vout->p->control,
- VOUT_CONTROL_CHANGE_INTERLACE, false);
- else
- vout_control_PushBool(&vout->p->control,
- VOUT_CONTROL_CHANGE_INTERLACE, true);
+ vout_ControlChangeInterlacing(vout, deinterlace_state != 0 && (is_needed || deinterlace_state >= 0));
/* */
free(old);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 288f273e61..4c209ff292 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -598,6 +598,12 @@ void vout_ControlChangeFilters(vout_thread_t *vout, const char *filters)
filters);
}
+void vout_ControlChangeInterlacing(vout_thread_t *vout, bool set)
+{
+ assert(!vout->p->dummy);
+ vout_control_PushBool(&vout->p->control, VOUT_CONTROL_CHANGE_INTERLACE, set);
+}
+
void vout_ControlChangeSubSources(vout_thread_t *vout, const char *filters)
{
assert(!vout->p->dummy);
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 6529c9846b..abeb4c24e5 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -251,6 +251,7 @@ void vout_ChangeCropRatio(vout_thread_t *, unsigned num, unsigned den);
void vout_ChangeCropWindow(vout_thread_t *, int x, int y, int width, int height);
void vout_ChangeCropBorder(vout_thread_t *, int left, int top, int right, int bottom);
void vout_ControlChangeFilters(vout_thread_t *, const char *);
+void vout_ControlChangeInterlacing(vout_thread_t *, bool);
void vout_ControlChangeSubSources(vout_thread_t *, const char *);
void vout_ControlChangeSubFilters(vout_thread_t *, const char *);
void vout_ChangeSpuChannelMargin(vout_thread_t *, enum vlc_vout_order order, int);
More information about the vlc-commits
mailing list