FFmpeg: Fix failing to record videos with CRF video (fixes #3368)

This commit is contained in:
Vicki Pfau 2024-12-24 18:54:10 -08:00
parent 08430fc058
commit d82fc3dec1
2 changed files with 4 additions and 1 deletions

View File

@ -18,6 +18,7 @@ Emulation fixes:
Other fixes:
- Core: Fix inconsistencies with setting game-specific overrides (fixes mgba.io/i/2963)
- Debugger: Fix writing to specific segment in command-line debugger
- FFmpeg: Fix failing to record videos with CRF video (fixes mgba.io/i/3368)
- GB Serialize: Prevent loading invalid states where LY >= 144 in modes other than 1
- GBA: Fix getting game info for multiboot ROMs
- GBA Core: Fix booting into BIOS when skip BIOS is enabled

View File

@ -384,7 +384,9 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
encoder->videoStream = avformat_new_stream(encoder->context, vcodec);
encoder->video = encoder->videoStream->codec;
#endif
encoder->video->bit_rate = encoder->videoBitrate;
if (encoder->videoBitrate >= 0) {
encoder->video->bit_rate = encoder->videoBitrate;
}
encoder->video->width = encoder->width;
encoder->video->height = encoder->height;
encoder->video->time_base = (AVRational) { encoder->frameCycles * encoder->frameskip, encoder->cycles };