samplefmt: make av_samples_alloc() initialize the data to silence.
Right now the buffer is zeroed, which does not represent silence for U8(P).
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user