audiosink: Fill in the correct silence

For unsigned raw formats this is not all zeroes, and for non-raw formats
we just continue to assume all zeroes for now.

https://bugzilla.gnome.org/show_bug.cgi?id=739446
This commit is contained in:
Thomas Roos 2015-01-21 08:47:26 +01:00 committed by Sebastian Dröge
parent ce8d261cd6
commit f0f854d501

View file

@ -417,7 +417,17 @@ gst_audio_sink_ring_buffer_acquire (GstAudioRingBuffer * buf,
spec->seglatency = spec->segtotal + 1;
buf->size = spec->segtotal * spec->segsize;
buf->memory = g_malloc0 (buf->size);
buf->memory = g_malloc (buf->size);
if (buf->spec.type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) {
gst_audio_format_fill_silence (buf->spec.info.finfo, buf->memory,
buf->size);
} else {
/* FIXME, non-raw formats get 0 as the empty sample */
memset (buf->memory, 0, buf->size);
}
return TRUE;