[vlc-devel] [PATCH] deinterlace: fix field duration based on the source frame rate

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 25 10:21:33 CEST 2019


The frame rate is a field per second. To get a duration we divide seconds by
the number of fields. This what the vlc_tick_from_samples() call does. But we
divide by 0 without this fix.
---
 modules/video_filter/deinterlace/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_filter/deinterlace/common.c b/modules/video_filter/deinterlace/common.c
index 11950166788..f0bc3e830ed 100644
--- a/modules/video_filter/deinterlace/common.c
+++ b/modules/video_filter/deinterlace/common.c
@@ -92,7 +92,7 @@ vlc_tick_t GetFieldDuration(const struct deinterlace_ctx *p_context,
         /* One field took this long. */
         i_field_dur = (p_pic->date - p_context->meta[i].pi_date) / i_fields_total;
     }
-    else if (fmt->i_frame_rate_base)
+    else if (fmt->i_frame_rate)
         i_field_dur = vlc_tick_from_samples( fmt->i_frame_rate_base, fmt->i_frame_rate);
 
     /* Note that we default to field duration 0 if it could not be
-- 
2.17.1



More information about the vlc-devel mailing list