From 1b9dd608376e08a4797eb11ca11fb3c5229dd395 Mon Sep 17 00:00:00 2001 From: Pavel Tcherniaev Date: Tue, 9 Jul 2024 07:59:41 -0700 Subject: [PATCH] Fixed bug with videoDecodeBatch (#375) * fixed bug with videoDecodeBatch * changed if statement to check n_frame_returned --- samples/videoDecodeBatch/videodecodebatch.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/samples/videoDecodeBatch/videodecodebatch.cpp b/samples/videoDecodeBatch/videodecodebatch.cpp index 702199010c..44b32c7116 100644 --- a/samples/videoDecodeBatch/videodecodebatch.cpp +++ b/samples/videoDecodeBatch/videodecodebatch.cpp @@ -125,9 +125,11 @@ void DecProc(RocVideoDecoder *p_dec, VideoDemuxer *demuxer, int *pn_frame, doubl n_frame_returned = p_dec->DecodeFrame(p_video, n_video_bytes, 0, pts); n_frame += n_frame_returned; if (b_dump_output_frames && mem_type != OUT_SURFACE_MEM_NOT_MAPPED) { - if (!n_frame && !p_dec->GetOutputSurfaceInfo(&surf_info)) { - std::cerr << "Error: Failed to get Output Surface Info!" << std::endl; - break; + if (n_frame_returned) { + if (!p_dec->GetOutputSurfaceInfo(&surf_info)) { + std::cerr << "Error: Failed to get Output Surface Info!" << std::endl; + break; + } } for (int i = 0; i < n_frame_returned; i++) { p_frame = p_dec->GetFrame(&pts);