From 696b8cdc40f033ff0a45ebe620279130152fb2f8 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Sat, 21 Feb 2015 17:41:50 +0100 Subject: [PATCH] audiodecoder: drain current segment upon new one to ensure correct flow return See also https://bugzilla.gnome.org/show_bug.cgi?id=709224 --- gst-libs/gst/audio/gstaudiodecoder.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index cb9c2ab..0aaf1a6 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -2040,6 +2040,11 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event) GstFormat format; GST_AUDIO_DECODER_STREAM_LOCK (dec); + /* finish data in current segment because upstream now thinks in terms + * of a new segment so it will get confused if remaining data of the old + * segment is delay decoded and dropped with EOS return due to clipping */ + gst_audio_decoder_flush (dec, FALSE); + gst_event_copy_segment (event, &seg); format = seg.format; -- 2.7.4