From 27b203b030c8a80f26a8f7c35abbb53ca7c0b0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 6 Feb 2010 18:19:27 +0100 Subject: [PATCH] flacdec: Only flush the FLAC decoder if it wasn't created right before If the FLAC decoder is flushed, its state will be set to frame-sync mode, which will sync to the next *audio* frame and makes it ignore all headers. This prevented tags and everything else to show up when using flacdec in push mode. Fixes bug #608843. --- ext/flac/gstflacdec.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 2759b0dff0..8d4805d2f4 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -1271,8 +1271,8 @@ gst_flac_dec_chain (GstPad * pad, GstBuffer * buf) dec = GST_FLAC_DEC (GST_PAD_PARENT (pad)); GST_LOG_OBJECT (dec, "buffer with ts=%" GST_TIME_FORMAT ", end_offset=%" - G_GINT64_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), - GST_BUFFER_OFFSET_END (buf)); + G_GINT64_FORMAT ", size=%u", GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), + GST_BUFFER_OFFSET_END (buf), GST_BUFFER_SIZE (buf)); if (dec->init) { GST_DEBUG_OBJECT (dec, "initializing decoder"); @@ -1286,9 +1286,7 @@ gst_flac_dec_chain (GstPad * pad, GstBuffer * buf) } GST_DEBUG_OBJECT (dec, "initialized (framed=%d)", dec->framed); dec->init = FALSE; - } - - if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT)) { + } else if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT)) { /* Clear the adapter and the decoder */ gst_adapter_clear (dec->adapter); FLAC__stream_decoder_flush (dec->decoder);