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);