wpesrcbin: Fix audio metadata

The meta expects the number of samples in the buffer, not the total size.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5531>
This commit is contained in:
Philippe Normand 2023-10-23 17:24:40 +01:00 committed by GStreamer Marge Bot
parent 7d64943b9d
commit 7fd7917c78

View file

@ -284,7 +284,9 @@ gst_wpe_src_push_audio_buffer (GstWpeSrc* src, guint32 id, guint64 size)
gpointer data = mmap (0, size, PROT_READ, MAP_PRIVATE, audio_pad->fd, 0);
buffer = gst_buffer_new_memdup (data, size);
munmap (data, size);
gst_buffer_add_audio_meta (buffer, &audio_pad->info, size, NULL);
gst_buffer_add_audio_meta(
buffer, &audio_pad->info,
size / GST_AUDIO_INFO_BPF(&audio_pad->info), NULL);
audio_pad->buffer_time = gst_element_get_current_running_time (GST_ELEMENT (src));
GST_BUFFER_DTS (buffer) = audio_pad->buffer_time;