faac: recreate encoder after flushing

... since it appears the existing one can't be bothered anymore to produce
some output.
This commit is contained in:
Mark Nauwelaerts 2011-12-22 17:15:28 +01:00
parent f76b7c9527
commit 5bccb02a90

View file

@ -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;