[vlc-commits] [Git][videolan/vlc][master] video_output: refactor interlacing change detection
Jean-Baptiste Kempf
gitlab at videolan.org
Wed Jun 9 17:06:01 UTC 2021
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
122661ec by Alexandre Janniaux at 2021-06-09T14:44:15+00:00
video_output: refactor interlacing change detection
Refactor the boolean to int arithmetic so as to keep only boolean
operation. Name the deadline so that the condition more easily reflects
the comment above.
No functional changes.
- - - - -
1 changed file:
- src/video_output/interlacing.c
Changes:
=====================================
src/video_output/interlacing.c
=====================================
@@ -156,12 +156,14 @@ void vout_ReinitInterlacingSupport(vout_thread_t *vout, vout_thread_private_t *s
void vout_SetInterlacingState(vout_thread_t *vout, vout_thread_private_t *sys, bool is_interlaced)
{
+ const bool interlacing_change =
+ is_interlaced != sys->interlacing.is_interlaced;
+
/* Wait 30s before quiting interlacing mode */
- const int interlacing_change = (!!is_interlaced)
- - (!!sys->interlacing.is_interlaced);
- if (interlacing_change == 1 ||
- (interlacing_change == -1 &&
- sys->interlacing.date + VLC_TICK_FROM_SEC(30) < vlc_tick_now()))
+ const bool is_after_deadline =
+ sys->interlacing.date + VLC_TICK_FROM_SEC(30) < vlc_tick_now();
+
+ if (interlacing_change && (is_interlaced || is_after_deadline))
{
msg_Dbg(vout, "Detected %s video",
is_interlaced ? "interlaced" : "progressive");
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/122661ecd9967b777743967e29d13ca0da544259
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/122661ecd9967b777743967e29d13ca0da544259
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list