From: Matthew Waters Date: Wed, 29 Mar 2023 23:11:11 +0000 (+1100) Subject: ccconverter: reintroduce frame count reset on cycle completion X-Git-Tag: 1.22.7~335 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=785427bab19365fb42757d62fd1d522292c95716;p=platform%2Fupstream%2Fgstreamer.git ccconverter: reintroduce frame count reset on cycle completion Part-of: --- 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;