basetextoverlay: Don't miscalculate text running times
authorJan Schmidt <jan@centricular.com>
Wed, 27 Jul 2022 12:34:42 +0000 (22:34 +1000)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 12 Aug 2022 12:08:18 +0000 (12:08 +0000)
commitc668f6fc227aaa272b49878d0a15e19d3ffc547e
tree41e72af7ef72f222f325b85ad305703fd093cdc0
parent0d07ff60c92e6c08296d9b1495afb89558b07276
basetextoverlay: Don't miscalculate text running times

When a new segment event arrives, it immediately updates
the current stored segment, which was used for calculating
the running time of the current text buffer for every
passing video frame. This means a segment that arrives
after the text buffer might get used to (mis)calculate
the running times subsequently.

Instead, calculate and store the right running time
using the current segment when storing the buffer. Later
the stored segment can get freely updated.

This fixes the case where pieces of video and text streams
are seamlessly concatenated and fed through the text overlay.
Previously, it could lead to the current text buffer suddenly
have a massive running time and blocking all further input.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2802>
subprojects/gst-plugins-base/ext/pango/gstbasetextoverlay.c
subprojects/gst-plugins-base/ext/pango/gstbasetextoverlay.h