Closed paveltc closed 2 months ago
@paveltc Changing AND to OR can result in error report, since at the beginning of the decode session, a decode call can return 0 output frame so n_frame can be 0, triggering the error report.
Do both HEVC and AVC conformance tests pass with this change?
Fixed the bug where some output streams were 0 bytes. Also fixes bug where some output streams are an order of magnitude larger in size than they should be. Original code:
if (!n_frame && !p_dec->GetOutputSurfaceInfo(&surf_info)) { std::cerr << "Error: Failed to get Output Surface Info!" << std::endl; break; }
This evaluates as false if n_frame doesn't return false or if surf_info is not false. So both need to be false to throw the error, otherwise it goes through. Code is changed to:
if(n_frame){ if(!p_dec->GetOutputSurfaceInfo(&surf_info)){ std::cerr << "Error: Failed to get Output Surface Info!" << std::endl; break; } }
Now if n_frame evaluates to true but surf_info does not it throws the error, which should be the correct behavior.