We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent daa649c commit e8b0cfdCopy full SHA for e8b0cfd
src/recorder.cpp
@@ -68,14 +68,16 @@ geode::Result<> Recorder::init(const RenderSettings& settings) {
68
m_codecContext->pix_fmt = AV_PIX_FMT_NONE;
69
m_videoStream->time_base = m_codecContext->time_base;
70
71
+ if(!m_codecContext->pix_fmt)
72
+ return geode::Err("Codec does not have any supported pixel formats.");
73
+
74
if (const AVPixelFormat *pix_fmt = m_codec->pix_fmts) {
75
while (*pix_fmt != AV_PIX_FMT_NONE) {
76
if(*pix_fmt == static_cast<AVPixelFormat>(settings.m_pixelFormat))
77
m_codecContext->pix_fmt = *pix_fmt;
78
++pix_fmt;
79
}
80
-
81
if(m_codecContext->pix_fmt == AV_PIX_FMT_NONE) {
82
geode::log::info("Codec {} does not support pixel format, defaulting to codec's format", settings.m_codec);
83
m_codecContext->pix_fmt = m_codec->pix_fmts[0];
0 commit comments