audiosrc: 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:
Sebastian Dröge 2015-01-21 09:37:30 +01:00
parent f0f854d501
commit e63ad51dab

View file

@ -393,7 +393,14 @@ gst_audio_src_ring_buffer_acquire (GstAudioRingBuffer * buf,
goto could_not_open; goto could_not_open;
buf->size = spec->segtotal * spec->segsize; 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);
}
abuf = GST_AUDIO_SRC_RING_BUFFER (buf); abuf = GST_AUDIO_SRC_RING_BUFFER (buf);
abuf->running = TRUE; abuf->running = TRUE;