From 2d38d2f1d3822f37c73cf446d1394b60792250a9 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 14 Feb 2018 13:11:37 +0200 Subject: [PATCH] gstaudiodecoder: do not aggregate output if buffers are planar Aggregation will break the layout, as it concatenates buffers, and fixing it here would be much more inefficient than configuring the actual decoder implementation to output larger buffers. https://bugzilla.gnome.org/show_bug.cgi?id=705977 --- gst-libs/gst/audio/gstaudiodecoder.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 75a6328ffb..2b629e9f08 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -93,7 +93,10 @@ * * In non-live pipelines, baseclass can also (configurably) arrange for * output buffer aggregation which may help to redue large(r) numbers of - * small(er) buffers being pushed and processed downstream. + * small(er) buffers being pushed and processed downstream. Note that this + * feature is only available if the buffer layout is interleaved. For planar + * buffers, the decoder implementation is fully responsible for the output + * buffer size. * * On the other hand, it should be noted that baseclass only provides limited * seeking support (upon explicit subclass request), as full-fledged support @@ -992,7 +995,8 @@ gst_audio_decoder_output (GstAudioDecoder * dec, GstBuffer * buf) again: inbuf = NULL; - if (priv->agg && dec->priv->latency > 0) { + if (priv->agg && dec->priv->latency > 0 && + priv->ctx.info.layout == GST_AUDIO_LAYOUT_INTERLEAVED) { gint av; gboolean assemble = FALSE; const GstClockTimeDiff tol = 10 * GST_MSECOND;