dvbsubenc: Forward GAP events as-is if we wouldn't produce an end packet and are not in the middle of an existing subtitle

An end packet is only produced once for the last subtitle, so multiple
GAP events between subtitles would result only in a single end packet
and nothing else otherwise. This would potentially starve downstream
then, so instead forward the GAP events in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3536>
This commit is contained in:
Sebastian Dröge 2022-12-07 10:21:52 +02:00 committed by Tim-Philipp Müller
parent c4ed258573
commit fbffce6d0d

View file

@ -560,9 +560,13 @@ gst_dvb_sub_enc_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
}
case GST_EVENT_GAP:
{
if (!GST_CLOCK_TIME_IS_VALID (enc->current_end_time)) {
ret = gst_pad_event_default (pad, parent, event);
} else {
GstClockTime start, duration;
gst_event_parse_gap (event, &start, &duration);
if (GST_CLOCK_TIME_IS_VALID (start)) {
if (GST_CLOCK_TIME_IS_VALID (duration))
start += duration;
@ -578,6 +582,7 @@ gst_dvb_sub_enc_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
gst_event_unref (event);
ret = TRUE;
}
break;
}
case GST_EVENT_SEGMENT: