aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/samplefmt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-10-03 07:54:45 +0200
committerAnton Khirnov <anton@khirnov.net>2012-10-04 08:05:21 +0200
commitcd15b7c03d8df29d4c69b0620cf27d4a8c9dfb65 (patch)
treee006be6e1ee440f067af8b1f8c0e943522310cae /libavutil/samplefmt.c
parentc9df48909e03031aeb90facf9f307f3103691792 (diff)
downloadffmpeg-cd15b7c03d8df29d4c69b0620cf27d4a8c9dfb65.tar.gz
samplefmt: make av_samples_alloc() initialize the data to silence.
Right now the buffer is zeroed, which does not represent silence for U8(P).
Diffstat (limited to 'libavutil/samplefmt.c')
-rw-r--r--libavutil/samplefmt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index 102376ae38..4f6dfd7889 100644
--- a/libavutil/samplefmt.c
+++ b/libavutil/samplefmt.c
@@ -174,7 +174,7 @@ int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
if (size < 0)
return size;
- buf = av_mallocz(size);
+ buf = av_malloc(size);
if (!buf)
return AVERROR(ENOMEM);
@@ -184,6 +184,9 @@ int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels,
av_free(buf);
return size;
}
+
+ av_samples_set_silence(audio_data, 0, nb_samples, nb_channels, sample_fmt);
+
return 0;
}