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) {
6868 m_codecContext->pix_fmt = AV_PIX_FMT_NONE;
6969 m_videoStream->time_base = m_codecContext->time_base ;
7070
71+ if (!m_codecContext->pix_fmt )
72+ return geode::Err (" Codec does not have any supported pixel formats." );
73+
7174 if (const AVPixelFormat *pix_fmt = m_codec->pix_fmts ) {
7275 while (*pix_fmt != AV_PIX_FMT_NONE) {
7376 if (*pix_fmt == static_cast <AVPixelFormat>(settings.m_pixelFormat ))
7477 m_codecContext->pix_fmt = *pix_fmt;
7578 ++pix_fmt;
7679 }
7780 }
78-
7981 if (m_codecContext->pix_fmt == AV_PIX_FMT_NONE) {
8082 geode::log::info (" Codec {} does not support pixel format, defaulting to codec's format" , settings.m_codec );
8183 m_codecContext->pix_fmt = m_codec->pix_fmts [0 ];
You can’t perform that action at this time.
0 commit comments