interaudiosrc: Add audio meta to buffers containing non-interleaved samples
authorPhilippe Normand <philn@igalia.com>
Wed, 13 Sep 2023 14:11:32 +0000 (15:11 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 28 Sep 2023 13:14:38 +0000 (15:14 +0200)
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/5416>

subprojects/gst-plugins-bad/gst/inter/gstinteraudiosrc.c

index f516a585fbd2aeec1c58f2baedb36c60b4c01eb9..ef2b7fc4c106b5c5d16b9ad208af4f030ef07585 100644 (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;