[FFmpeg-cvslog] avcodec/cuviddec: print error when queueing frames fails
Timo Rothenpieler
git at videolan.org
Wed May 21 02:22:17 EEST 2025
ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Wed May 21 01:15:29 2025 +0200| [431e2cae87b67070df5c618a68cec89d61518ff4] | committer: Timo Rothenpieler
avcodec/cuviddec: print error when queueing frames fails
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=431e2cae87b67070df5c618a68cec89d61518ff4
---
libavcodec/cuviddec.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index 6575f0f6b1..bb24fad3d4 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -424,6 +424,7 @@ static int CUDAAPI cuvid_handle_picture_display(void *opaque, CUVIDPARSERDISPINF
AVCodecContext *avctx = opaque;
CuvidContext *ctx = avctx->priv_data;
CuvidParsedFrame parsed_frame = { { 0 } };
+ int ret;
parsed_frame.dispinfo = *dispinfo;
ctx->internal_error = 0;
@@ -432,13 +433,20 @@ static int CUDAAPI cuvid_handle_picture_display(void *opaque, CUVIDPARSERDISPINF
parsed_frame.dispinfo.progressive_frame = ctx->progressive_sequence;
if (ctx->deint_mode_current == cudaVideoDeinterlaceMode_Weave) {
- av_fifo_write(ctx->frame_queue, &parsed_frame, 1);
+ ret = av_fifo_write(ctx->frame_queue, &parsed_frame, 1);
+ if (ret < 0)
+ av_log(avctx, AV_LOG_ERROR, "Writing frame to fifo failed!\n");
} else {
parsed_frame.is_deinterlacing = 1;
- av_fifo_write(ctx->frame_queue, &parsed_frame, 1);
+ ret = av_fifo_write(ctx->frame_queue, &parsed_frame, 1);
+ if (ret < 0)
+ av_log(avctx, AV_LOG_ERROR, "Writing first frame to fifo failed!\n");
+
if (!ctx->drop_second_field) {
parsed_frame.second_field = 1;
- av_fifo_write(ctx->frame_queue, &parsed_frame, 1);
+ ret = av_fifo_write(ctx->frame_queue, &parsed_frame, 1);
+ if (ret < 0)
+ av_log(avctx, AV_LOG_ERROR, "Writing second frame to fifo failed!\n");
}
}
More information about the ffmpeg-cvslog
mailing list