[FFmpeg-devel] [PATCH] doc/examples/vaapi_transcode: fix null framerate

Xiang, Haihao haihao.xiang at intel.com
Fri Mar 31 17:45:10 EEST 2023


On Do, 2023-03-30 at 16:28 +0800, jianfeng.zheng wrote:
> When framerate in codec layer is null, guess from stream.
> 
> Signed-off-by: jianfeng.zheng <jianfeng.zheng at mthreads.com>
> ---
>  doc/examples/vaapi_transcode.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/doc/examples/vaapi_transcode.c b/doc/examples/vaapi_transcode.c
> index 8367cb3040..cdcc4e263a 100644
> --- a/doc/examples/vaapi_transcode.c
> +++ b/doc/examples/vaapi_transcode.c
> @@ -103,6 +103,10 @@ static int open_input_file(const char *filename)
>          fprintf(stderr, "Failed to open codec for decoding. Error code:
> %s\n",
>                  av_err2str(ret));
>  
> +    if (decoder_ctx->framerate.num == 0 &&
> +                       video->r_frame_rate.num > 0 && video->r_frame_rate.den
> > 0)
> +        decoder_ctx->framerate = video->r_frame_rate;
> +
>      return ret;
>  }
> 

LGTM, will apply,

Thanks
Haihao


>  



More information about the ffmpeg-devel mailing list