Right now the buffer is zeroed, which does not represent silence for U8(P).
if (size < 0)
return size;
- buf = av_mallocz(size);
+ buf = av_malloc(size);
if (!buf)
return AVERROR(ENOMEM);
av_free(buf);
return size;
}
+
+ av_samples_set_silence(audio_data, 0, nb_samples, nb_channels, sample_fmt);
+
return 0;
}
* Allocate a samples buffer for nb_samples samples, and fill data pointers and
* linesize accordingly.
* The allocated samples buffer can be freed by using av_freep(&audio_data[0])
+ * Allocated data will be initialized to silence.
*
* @see enum AVSampleFormat
* The documentation for AVSampleFormat describes the data layout.
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 41
-#define LIBAVUTIL_VERSION_MICRO 0
+#define LIBAVUTIL_VERSION_MICRO 1
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \