mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
encoders/ffmpeg: Assume source pixel format for empty support lists
This commit is contained in:
parent
a9da1481d7
commit
d85ced4107
1 changed files with 5 additions and 1 deletions
|
@ -565,7 +565,11 @@ void ffmpeg_instance::initialize_sw(obs_data_t* settings)
|
|||
AVPixelFormat _pixfmt_target = static_cast<AVPixelFormat>(obs_data_get_int(settings, KEY_FFMPEG_COLORFORMAT));
|
||||
if (_pixfmt_target == AV_PIX_FMT_NONE) {
|
||||
// Find the best conversion format.
|
||||
_pixfmt_target = ::ffmpeg::tools::get_least_lossy_format(_codec->pix_fmts, _pixfmt_source);
|
||||
if (_codec->pix_fmts) {
|
||||
_pixfmt_target = ::ffmpeg::tools::get_least_lossy_format(_codec->pix_fmts, _pixfmt_source);
|
||||
} else { // If there are no supported formats, just pass in the current one.
|
||||
_pixfmt_target = _pixfmt_source;
|
||||
}
|
||||
|
||||
if (_handler) // Allow Handler to override the automatic color format for sanity reasons.
|
||||
_handler->override_colorformat(_pixfmt_target, settings, _codec, _context);
|
||||
|
|
Loading…
Reference in a new issue