summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/AVIDump.cpp
diff options
context:
space:
mode:
authorVlad Firoiu <vladfi2@gmail.com>2017-12-29 09:00:55 -0500
committerLéo Lam <leo@innovatetechnologi.es>2018-01-03 13:23:10 +0100
commit330881ae80387a0acced81fc5e5409a5b8a4972e (patch)
treef66e5a8514457285bde3c0096540b00694d9756d /Source/Core/VideoCommon/AVIDump.cpp
parent1f89d91deb3d80fc54ab4314a992cd851d843b8d (diff)
Allow users to specify the encoder used for framedumping.
Diffstat (limited to 'Source/Core/VideoCommon/AVIDump.cpp')
-rw-r--r--Source/Core/VideoCommon/AVIDump.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/AVIDump.cpp b/Source/Core/VideoCommon/AVIDump.cpp
index 6a7590f034..36340a4679 100644
--- a/Source/Core/VideoCommon/AVIDump.cpp
+++ b/Source/Core/VideoCommon/AVIDump.cpp
@@ -159,7 +159,15 @@ bool AVIDump::CreateVideoFile()
const AVCodec* codec = nullptr;
- codec = avcodec_find_encoder(codec_id);
+ if (!g_Config.sDumpEncoder.empty())
+ {
+ codec = avcodec_find_encoder_by_name(g_Config.sDumpEncoder.c_str());
+ if (!codec)
+ WARN_LOG(VIDEO, "Invalid encoder %s", g_Config.sDumpEncoder.c_str());
+ }
+ if (!codec)
+ codec = avcodec_find_encoder(codec_id);
+
s_codec_context = avcodec_alloc_context3(codec);
if (!codec || !s_codec_context)
{