From d6def0d407ac6d5440cd6b2ebc1a16c14054c824 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 23 Dec 2014 23:13:52 -0800 Subject: [PATCH] Video: Ensure FFmpeg encoder has audio frames --- CHANGES | 1 + src/platform/ffmpeg/ffmpeg-encoder.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index d54afe1ba..1a53e5c45 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,7 @@ Bugfixes: - GBA Audio: Make larger buffer sizes than 2048 actually work properly - GBA Audio: Audio buffer sizes are now correct sizes for both sample rates - GBA Video: Fix blend issues with obscured middle layers + - Video: Ensure FFmpeg encoder has audio frames Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it diff --git a/src/platform/ffmpeg/ffmpeg-encoder.c b/src/platform/ffmpeg/ffmpeg-encoder.c index 9e8734fe0..52f8f6806 100644 --- a/src/platform/ffmpeg/ffmpeg-encoder.c +++ b/src/platform/ffmpeg/ffmpeg-encoder.c @@ -225,6 +225,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) { #else encoder->audioFrame = avcodec_alloc_frame(); #endif + if (!encoder->audio->frame_size) { + encoder->audio->frame_size = 1024; + } encoder->audioFrame->nb_samples = encoder->audio->frame_size; encoder->audioFrame->format = encoder->audio->sample_fmt; encoder->audioFrame->pts = 0;