interaudiosrc: Add audio meta to buffers containing non-interleaved samples

Without this a downstream audioconverter wouldn't be able to map the
GstAudioBuffer prior to conversion.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5324>
This commit is contained in:
Philippe Normand 2023-09-13 15:11:32 +01:00 committed by GStreamer Marge Bot
parent 324d5c6460
commit 46dbe2a372

View file

@ -412,6 +412,12 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
}
n = period_samples;
/* audioconvert expects an audio meta for planar layout audio inputs. */
if (GST_AUDIO_INFO_LAYOUT (&interaudiosrc->info) ==
GST_AUDIO_LAYOUT_NON_INTERLEAVED) {
gst_buffer_add_audio_meta (buffer, &interaudiosrc->info, n, NULL);
}
GST_BUFFER_OFFSET (buffer) = interaudiosrc->n_samples;
GST_BUFFER_OFFSET_END (buffer) = interaudiosrc->n_samples + n;
GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE;