mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
audiorate: Use gst_audio_format_fill_silence() instead of memset with 0 for generating silence
For unsigned formats, silence is not all bits 0.
This commit is contained in:
parent
dfa2f49523
commit
641428966e
1 changed files with 5 additions and 2 deletions
|
@ -535,14 +535,17 @@ gst_audio_rate_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
||||||
|
|
||||||
while (fillsamples > 0) {
|
while (fillsamples > 0) {
|
||||||
guint64 cursamples = MIN (fillsamples, rate);
|
guint64 cursamples = MIN (fillsamples, rate);
|
||||||
|
GstMapInfo fillmap;
|
||||||
|
|
||||||
fillsamples -= cursamples;
|
fillsamples -= cursamples;
|
||||||
fillsize = cursamples * bpf;
|
fillsize = cursamples * bpf;
|
||||||
|
|
||||||
fill = gst_buffer_new_and_alloc (fillsize);
|
fill = gst_buffer_new_and_alloc (fillsize);
|
||||||
|
|
||||||
/* FIXME, 0 might not be the silence byte for the negotiated format. */
|
gst_buffer_map (fill, &fillmap, GST_MAP_WRITE);
|
||||||
gst_buffer_memset (fill, 0, 0, fillsize);
|
gst_audio_format_fill_silence (audiorate->info.finfo, fillmap.data,
|
||||||
|
fillmap.size);
|
||||||
|
gst_buffer_unmap (fill, &fillmap);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (audiorate, "inserting %" G_GUINT64_FORMAT " samples",
|
GST_DEBUG_OBJECT (audiorate, "inserting %" G_GUINT64_FORMAT " samples",
|
||||||
cursamples);
|
cursamples);
|
||||||
|
|
Loading…
Reference in a new issue