@@ -939,9 +939,10 @@ void VideoDecoder::convertAVFrameToDecodedOutputOnCPU(
939
939
outputTensor = preAllocatedOutputTensor.value_or (allocateEmptyHWCTensor (
940
940
expectedOutputHeight, expectedOutputWidth, torch::kCPU ));
941
941
942
- if (!streamInfo.swsContext || streamInfo.prevFrame != frameContext) {
942
+ if (!streamInfo.swsContext ||
943
+ streamInfo.prevFrameContext != frameContext) {
943
944
createSwsContext (streamInfo, frameContext, frame->colorspace );
944
- streamInfo.prevFrame = frameContext;
945
+ streamInfo.prevFrameContext = frameContext;
945
946
}
946
947
int resultHeight =
947
948
convertFrameToTensorUsingSwsScale (streamIndex, frame, outputTensor);
@@ -960,10 +961,10 @@ void VideoDecoder::convertAVFrameToDecodedOutputOnCPU(
960
961
streamInfo.colorConversionLibrary ==
961
962
ColorConversionLibrary::FILTERGRAPH) {
962
963
if (!streamInfo.filterState .filterGraph ||
963
- streamInfo.prevFrame != frameContext) {
964
+ streamInfo.prevFrameContext != frameContext) {
964
965
createFilterGraph (
965
966
streamInfo, expectedOutputHeight, expectedOutputWidth);
966
- streamInfo.prevFrame = frameContext;
967
+ streamInfo.prevFrameContext = frameContext;
967
968
}
968
969
outputTensor = convertFrameToTensorUsingFilterGraph (streamIndex, frame);
969
970
0 commit comments