From de56a874ae02a7335239fad5c6ed4dac710ab4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 8 Mar 2010 16:47:04 +0000 Subject: [PATCH] flacdec: don't send second newsegment event in framed mode, fixes long playback delay Don't send another newsegment event if the upstream muxer/parser has already sent one (otherwise the sink will wait for $duration before starting playback). Fixes long delay until playback starts with flac-in-ogg files. Fixes #610959. --- ext/flac/gstflacdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 8d4805d2f4..3fc99b9b7a 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -578,7 +578,9 @@ gst_flac_dec_metadata_cb (const FLAC__StreamDecoder * decoder, GST_DEBUG_OBJECT (flacdec, "total samples = %" G_GINT64_FORMAT, samples); - if (samples > 0) { + /* in framed mode the demuxer/parser upstream has already pushed a + * newsegment event in TIME format which we've passed on */ + if (samples > 0 && !flacdec->framed) { gint64 duration; gst_segment_set_duration (&flacdec->segment, GST_FORMAT_DEFAULT,