From 320c0954a39cc8c31ceffa57c9ebe159f451d1a8 Mon Sep 17 00:00:00 2001 From: jeffqjiangNew <142832361+jeffqjiangNew@users.noreply.github.com> Date: Fri, 23 Feb 2024 22:54:29 -0500 Subject: [PATCH] * rocDecode: Take care of the case where DecodeFrame() does not return 1 (decoded frame number) so the accumulated decoded frame number does not match the user targeted frame number and the decoding will not stop. (#257) --- samples/videoDecode/videodecode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/videoDecode/videodecode.cpp b/samples/videoDecode/videodecode.cpp index 899d192525..221baa55c4 100644 --- a/samples/videoDecode/videodecode.cpp +++ b/samples/videoDecode/videodecode.cpp @@ -240,7 +240,7 @@ int main(int argc, char **argv) { auto time_per_decode = std::chrono::duration(end_time - start_time).count(); total_dec_time += time_per_decode; n_frame += n_frame_returned; - if (num_decoded_frames && num_decoded_frames == n_frame) { + if (num_decoded_frames && num_decoded_frames <= n_frame) { break; } } while (n_video_bytes);