From 91e53cd8349f6a6a74ef7bc9498052467345cff4 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sat, 27 Jan 2024 00:34:28 +0000 Subject: [PATCH] nvv4l2: do not override key_frame Some apps are managing this by replacing the ffmpeg get buffer function. Additionally, some badly coded apps use that for actually starting outputting to screen or framebuffer, even though the expected frames from the decoder are always full frames. --- libavcodec/nvv4l2_dec.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/nvv4l2_dec.c b/libavcodec/nvv4l2_dec.c index b2ac349201a..751f4379e89 100644 --- a/libavcodec/nvv4l2_dec.c +++ b/libavcodec/nvv4l2_dec.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023, CTCaer + * Copyright (c) 2021-2024, CTCaer * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -1236,12 +1236,13 @@ nvv4l2dec_decode(AVCodecContext *avctx, void *data, int *got_frame, if (_nvframe.pts != AV_NOPTS_VALUE) { avframe->pts = _nvframe.pts; } else { - avframe->pts = _nvframe.pts; + /*! NOTE: Investigate if setting reordered_opaque to pts instead + * is better for no-pts streams compatibility. + */ + avframe->pts = AV_NOPTS_VALUE; avframe->reordered_opaque = _nvframe.user_pts; } - avframe->key_frame = 0; - avctx->coded_width = _nvframe.width; avctx->coded_height = _nvframe.height; avctx->width = _nvframe.width; -- GitLab