summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-01-28 13:29:39 +0100
committerSebastian Dröge <sebastian@centricular.com>2016-01-28 13:29:39 +0100
commit641428966e09d16b0a46540040f2faf3791eb7c9 (patch)
tree7245f1ecdbef7846145e02c83ae9f457bb280af7 /gst
parentdfa2f4952321f72e664946d5537bf0291b24459f (diff)
downloadgstreamer-plugins-base-641428966e09d16b0a46540040f2faf3791eb7c9.tar.gz
audiorate: Use gst_audio_format_fill_silence() instead of memset with 0 for generating silence
For unsigned formats, silence is not all bits 0.
Diffstat (limited to 'gst')
-rw-r--r--gst/audiorate/gstaudiorate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/audiorate/gstaudiorate.c b/gst/audiorate/gstaudiorate.c
index 19661d802..1927ec3b1 100644
--- a/gst/audiorate/gstaudiorate.c
+++ b/gst/audiorate/gstaudiorate.c
@@ -535,14 +535,17 @@ gst_audio_rate_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
while (fillsamples > 0) {
guint64 cursamples = MIN (fillsamples, rate);
+ GstMapInfo fillmap;
fillsamples -= cursamples;
fillsize = cursamples * bpf;
fill = gst_buffer_new_and_alloc (fillsize);
- /* FIXME, 0 might not be the silence byte for the negotiated format. */
- gst_buffer_memset (fill, 0, 0, fillsize);
+ gst_buffer_map (fill, &fillmap, GST_MAP_WRITE);
+ 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",
cursamples);