mirror of https://github.com/mgba-emu/mgba.git
Video: Fix FFmpeg crashing when the file extension is wrong
This commit is contained in:
parent
24e10fe0df
commit
6938c8bea6
1
CHANGES
1
CHANGES
|
@ -37,6 +37,7 @@ Bugfixes:
|
||||||
- GBA Video: Fix sprite mis-ordering behavior in some cases (fixes #168)
|
- GBA Video: Fix sprite mis-ordering behavior in some cases (fixes #168)
|
||||||
- GBA Video: Fix window interactions with 16-color mode 0 mosaic
|
- GBA Video: Fix window interactions with 16-color mode 0 mosaic
|
||||||
- GBA Video: Fix sprite boundary conditions with mosaic
|
- GBA Video: Fix sprite boundary conditions with mosaic
|
||||||
|
- Video: Fix FFmpeg crashing when the file extension is wrong
|
||||||
Misc:
|
Misc:
|
||||||
- Qt: Disable sync to video by default
|
- Qt: Disable sync to video by default
|
||||||
- GBA: Exit cleanly on FATAL if the port supports it
|
- GBA: Exit cleanly on FATAL if the port supports it
|
||||||
|
|
|
@ -196,15 +196,15 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
|
||||||
encoder->currentVideoFrame = 0;
|
encoder->currentVideoFrame = 0;
|
||||||
encoder->nextAudioPts = 0;
|
encoder->nextAudioPts = 0;
|
||||||
|
|
||||||
|
AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0);
|
||||||
#ifndef USE_LIBAV
|
#ifndef USE_LIBAV
|
||||||
avformat_alloc_output_context2(&encoder->context, 0, 0, outfile);
|
avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile);
|
||||||
#else
|
#else
|
||||||
encoder->context = avformat_alloc_context();
|
encoder->context = avformat_alloc_context();
|
||||||
strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename));
|
strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename));
|
||||||
|
encoder->context->oformat = oformat;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
encoder->context->oformat = av_guess_format(encoder->containerFormat, 0, 0);
|
|
||||||
|
|
||||||
if (acodec) {
|
if (acodec) {
|
||||||
encoder->audioStream = avformat_new_stream(encoder->context, acodec);
|
encoder->audioStream = avformat_new_stream(encoder->context, acodec);
|
||||||
encoder->audio = encoder->audioStream->codec;
|
encoder->audio = encoder->audioStream->codec;
|
||||||
|
|
Loading…
Reference in New Issue