mirror of https://github.com/mgba-emu/mgba.git
FFmpeg: Fix buffer size rounding for audio encoding
This commit is contained in:
parent
a039e2fbef
commit
b68c714455
|
@ -881,7 +881,7 @@ void FFmpegEncoderSetInputSampleRate(struct FFmpegEncoder* encoder, int sampleRa
|
|||
}
|
||||
|
||||
void _ffmpegOpenResampleContext(struct FFmpegEncoder* encoder) {
|
||||
encoder->audioBufferSize = av_rescale_q(encoder->audioFrame->nb_samples, (AVRational) { 4, encoder->sampleRate }, (AVRational) { 1, encoder->isampleRate });
|
||||
encoder->audioBufferSize = av_rescale_q(encoder->audioFrame->nb_samples, (AVRational) { 1, encoder->sampleRate }, (AVRational) { 1, encoder->isampleRate }) * 4;
|
||||
encoder->audioBuffer = av_malloc(encoder->audioBufferSize);
|
||||
#ifdef USE_LIBAVRESAMPLE
|
||||
encoder->resampleContext = avresample_alloc_context();
|
||||
|
|
Loading…
Reference in New Issue