Video: Fix FFmpeg crashing when the file extension is wrong
Jeffrey Pfau jeffrey@endrift.com
Thu, 01 Jan 2015 14:51:20 -0800
2 files changed,
4 insertions(+),
3 deletions(-)
M
CHANGES
→
CHANGES
@@ -37,6 +37,7 @@ - Debugger: Fix watchpoints triggering too late
- 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 sprite boundary conditions with mosaic + - Video: Fix FFmpeg crashing when the file extension is wrong Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it
M
src/platform/ffmpeg/ffmpeg-encoder.c
→
src/platform/ffmpeg/ffmpeg-encoder.c
@@ -196,14 +196,14 @@ encoder->currentAudioFrame = 0;
encoder->currentVideoFrame = 0; encoder->nextAudioPts = 0; + AVOutputFormat* oformat = av_guess_format(encoder->containerFormat, 0, 0); #ifndef USE_LIBAV - avformat_alloc_output_context2(&encoder->context, 0, 0, outfile); + avformat_alloc_output_context2(&encoder->context, oformat, 0, outfile); #else encoder->context = avformat_alloc_context(); strncpy(encoder->context->filename, outfile, sizeof(encoder->context->filename)); + encoder->context->oformat = oformat; #endif - - encoder->context->oformat = av_guess_format(encoder->containerFormat, 0, 0); if (acodec) { encoder->audioStream = avformat_new_stream(encoder->context, acodec);