From 785427bab19365fb42757d62fd1d522292c95716 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 30 Mar 2023 10:11:11 +1100 Subject: [PATCH] ccconverter: reintroduce frame count reset on cycle completion Part-of: --- subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c b/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c index 8623913..aa451bb 100644 --- a/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c +++ b/subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c @@ -591,6 +591,11 @@ can_take_buffer (GstCCConverter * self, output_time_cmp = gst_util_fraction_compare (input_frame_n, input_frame_d, output_frame_n, output_frame_d); + if (output_time_cmp == 0) { + self->output_frames = 0; + self->input_frames = 0; + } + in_fps_entry = cdp_fps_entry_from_fps (self->in_fps_n, self->in_fps_d); if (!in_fps_entry || in_fps_entry->fps_n == 0) g_assert_not_reached (); @@ -1455,6 +1460,11 @@ can_generate_output (GstCCConverter * self) output_time_cmp = gst_util_fraction_compare (input_frame_n, input_frame_d, output_frame_n, output_frame_d); + if (output_time_cmp == 0) { + self->output_frames = 0; + self->input_frames = 0; + } + /* if the next output frame is at or before the current input frame */ if (output_time_cmp >= 0) return TRUE; -- 2.7.4