[FFmpeg-devel] [PATCH 2/4] avcodec/nvdec: correctly set output frame size

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Nov 12 03:19:52 EET 2017


2017-11-11 17:38 GMT+01:00 Timo Rothenpieler <timo at rothenpieler.org>:

> @@ -249,8 +249,9 @@ int ff_nvdec_decode_init(AVCodecContext *avctx, unsigned int dpb_size)
>
>      params.ulWidth             = avctx->coded_width;
>      params.ulHeight            = avctx->coded_height;
> -    params.ulTargetWidth       = avctx->coded_width;
> -    params.ulTargetHeight      = avctx->coded_height;
> +    params.display_area.top    = params.display_area.left   = 0;
> +    params.ulTargetWidth       = params.display_area.right  = frames_ctx->width;
> +    params.ulTargetHeight      = params.display_area.bottom = frames_ctx->height;

I wonder if the following is more readable and better fits the
existing assignments:
params.display_area.right  =
params.ulTargetWidth       = avctx->coded_width;
params.display_area.bottom =
params.ulTargetHeight      = avctx->coded_height;

Feel free to ignore, Carl Eugen


More information about the ffmpeg-devel mailing list