From 8a310dcfed11b644b75614d74f8bb819e65283d2 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 20 Jan 2022 23:49:56 -0800 Subject: [PATCH] FFmpeg: Fix GIF recording (fixes #2393) --- CHANGES | 1 + src/feature/ffmpeg/ffmpeg-encoder.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 8c6dd7b28..287bc4d9d 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,7 @@ Emulation fixes: Other fixes: - Core: Don't attempt to restore rewind diffs past start of rewind - FFmpeg: Fix crash when encoding audio with some containers + - FFmpeg: Fix GIF recording (fixes mgba.io/i/2393) - GB: Fix temporary saves - GB, GBA: Save writeback-pending masked saves on unload (fixes mgba.io/i/2396) Misc: diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c index 55c874692..ad76ca57b 100644 --- a/src/feature/ffmpeg/ffmpeg-encoder.c +++ b/src/feature/ffmpeg/ffmpeg-encoder.c @@ -785,7 +785,7 @@ void _ffmpegPostVideoFrame(struct mAVStream* stream, const color_t* pixels, size sws_scale(encoder->scaleContext, (const uint8_t* const*) &pixels, (const int*) &stride, 0, encoder->iheight, encoder->videoFrame->data, encoder->videoFrame->linesize); if (encoder->graph) { - if (av_buffersrc_add_frame(encoder->source, encoder->videoFrame) < 0) { + if (av_buffersrc_write_frame(encoder->source, encoder->videoFrame) < 0) { return; } while (true) {