From 5bccb02a90f0a529522d9a598f794122d5afaa09 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 22 Dec 2011 17:15:28 +0100 Subject: [PATCH] faac: recreate encoder after flushing ... since it appears the existing one can't be bothered anymore to produce some output. --- ext/faac/gstfaac.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c index 95f4909125..68c1e01328 100644 --- a/ext/faac/gstfaac.c +++ b/ext/faac/gstfaac.c @@ -691,6 +691,13 @@ gst_faac_handle_frame (GstAudioEncoder * enc, GstBuffer * in_buf) ret = gst_audio_encoder_finish_frame (enc, out_buf, faac->samples); } else { gst_buffer_unref (out_buf); + /* re-create encoder after final flush */ + if (!in_buf) { + GST_DEBUG_OBJECT (faac, "flushed; recreating encoder"); + gst_faac_close_encoder (faac); + if (!gst_faac_open_encoder (faac)) + ret = GST_FLOW_ERROR; + } } return ret;