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);
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to