wavparse: ensure that any pending segment is sent before an EOS event is sent

Specifically fixes seqnum handling when an aggregator-based element
(audiomixer et al) is downstream and a seek is performed that
immediately causes an EOS from wavparse.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2369>
This commit is contained in:
Matthew Waters 2022-05-03 17:27:32 +10:00 committed by Tim-Philipp Müller
parent 5f474c3743
commit ea5983c82b

View file

@ -2289,6 +2289,13 @@ pause:
if (G_UNLIKELY (wav->first)) { if (G_UNLIKELY (wav->first)) {
wav->first = FALSE; wav->first = FALSE;
gst_wavparse_add_src_pad (wav, NULL); gst_wavparse_add_src_pad (wav, NULL);
} else {
/* If we have a pending start segment, send it now. Can happen if a seek
* causes an immediate EOS */
if (G_UNLIKELY (wav->start_segment != NULL)) {
gst_pad_push_event (wav->srcpad, wav->start_segment);
wav->start_segment = NULL;
}
} }
/* perform EOS logic */ /* perform EOS logic */