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 7e1e7d2253
commit f40ea09127
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
0.10.5: (Future)
Other fixes:
- FFmpeg: Fix failing to record videos with CRF video (fixes mgba.io/i/3368)
- GBA Core: Fix booting into BIOS when skip BIOS is enabled
- GBA Hardware: Fix loading states unconditionally overwriting GPIO memory

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 };