if (ctx->codec->init_slice_params) {
err = ctx->codec->init_slice_params(avctx, pic, slice);
if (err < 0) {
- av_log(avctx, AV_LOG_ERROR, "Failed to initalise slice "
+ av_log(avctx, AV_LOG_ERROR, "Failed to initialise slice "
"parameters: %d.\n", err);
goto fail;
}
break;
}
}
- if (recon_format == AV_PIX_FMT_NONE)
- recon_format = constraints->valid_sw_formats[i];
+ if (recon_format == AV_PIX_FMT_NONE) {
+ // No match. Just use the first in the supported list and
+ // hope for the best.
+ recon_format = constraints->valid_sw_formats[0];
+ }
} else {
// No idea what to use; copy input format.
recon_format = ctx->input_frames->sw_format;