- if (hwaccel && hwaccel->alloc_frame) {
- ret = hwaccel->alloc_frame(avctx, frame);
- goto end;
- }
+ if (hwaccel) {
+ if (hwaccel->alloc_frame) {
+ ret = hwaccel->alloc_frame(avctx, frame);
+ goto end;
+ }
+ } else
+ avctx->sw_pix_fmt = avctx->pix_fmt;