File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -68,14 +68,16 @@ geode::Result<> Recorder::init(const RenderSettings& settings) {
68
68
m_codecContext->pix_fmt = AV_PIX_FMT_NONE;
69
69
m_videoStream->time_base = m_codecContext->time_base ;
70
70
71
+ if (!m_codecContext->pix_fmt )
72
+ return geode::Err (" Codec does not have any supported pixel formats." );
73
+
71
74
if (const AVPixelFormat *pix_fmt = m_codec->pix_fmts ) {
72
75
while (*pix_fmt != AV_PIX_FMT_NONE) {
73
76
if (*pix_fmt == static_cast <AVPixelFormat>(settings.m_pixelFormat ))
74
77
m_codecContext->pix_fmt = *pix_fmt;
75
78
++pix_fmt;
76
79
}
77
80
}
78
-
79
81
if (m_codecContext->pix_fmt == AV_PIX_FMT_NONE) {
80
82
geode::log::info (" Codec {} does not support pixel format, defaulting to codec's format" , settings.m_codec );
81
83
m_codecContext->pix_fmt = m_codec->pix_fmts [0 ];
You can’t perform that action at this time.
0 commit comments