@@ -939,9 +939,10 @@ void VideoDecoder::convertAVFrameToDecodedOutputOnCPU(
939939 outputTensor = preAllocatedOutputTensor.value_or (allocateEmptyHWCTensor (
940940 expectedOutputHeight, expectedOutputWidth, torch::kCPU ));
941941
942- if (!streamInfo.swsContext || streamInfo.prevFrame != frameContext) {
942+ if (!streamInfo.swsContext ||
943+ streamInfo.prevFrameContext != frameContext) {
943944 createSwsContext (streamInfo, frameContext, frame->colorspace );
944- streamInfo.prevFrame = frameContext;
945+ streamInfo.prevFrameContext = frameContext;
945946 }
946947 int resultHeight =
947948 convertFrameToTensorUsingSwsScale (streamIndex, frame, outputTensor);
@@ -960,10 +961,10 @@ void VideoDecoder::convertAVFrameToDecodedOutputOnCPU(
960961 streamInfo.colorConversionLibrary ==
961962 ColorConversionLibrary::FILTERGRAPH) {
962963 if (!streamInfo.filterState .filterGraph ||
963- streamInfo.prevFrame != frameContext) {
964+ streamInfo.prevFrameContext != frameContext) {
964965 createFilterGraph (
965966 streamInfo, expectedOutputHeight, expectedOutputWidth);
966- streamInfo.prevFrame = frameContext;
967+ streamInfo.prevFrameContext = frameContext;
967968 }
968969 outputTensor = convertFrameToTensorUsingFilterGraph (streamIndex, frame);
969970
0 commit comments