- ret = ff_thread_get_format(s->avctx, pix_fmts);
- if (ret < 0)
- goto fail;
- s->avctx->pix_fmt = ret;
+ ret = ff_thread_get_format(s->avctx, pix_fmts);
+ if (ret < 0)
+ goto fail;
+ s->avctx->pix_fmt = ret;
+ }
+ else {
+ s->avctx->pix_fmt = pix_fmt;
+ }