[Libav-user] I can't get audio decoding to work.

William MANCON wmancon at gmail.com
Wed Jun 22 01:05:51 CEST 2016


dataSize = av_samples_get_buffer_size(nullptr, codecCtx->channels,
frame->nb_samples, codecCtx->sample_fmt, 1);

while(totalBufferSize + dataSize > estimatedBuffSize)
{
estimatedBuffSize *= 1.1;
sampleBuffer = (uint8_t*)std::realloc(sampleBuffer, estimatedBuffSize);
}

std::memcpy(sampleBuffer + totalBufferSize, frame->data[0], dataSize);

>> I think av_samples_get_buffer_size could return negative value on error,
if it's the case, what will happend at this line ? :

> std::memcpy(sampleBuffer + totalBufferSize, frame->data[0], dataSize);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20160622/fb207fd2/attachment.html>


More information about the Libav-user mailing list