From f4f342aa7827834d486c7320be28c878eb27c4b0 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Tue, 3 May 2022 17:27:32 +1000 Subject: [PATCH] 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: --- subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c b/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c index 038bc9ca4c..6069dee18c 100644 --- a/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c +++ b/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c @@ -2289,6 +2289,13 @@ pause: if (G_UNLIKELY (wav->first)) { wav->first = FALSE; 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 */