Skip to content

Commit cd7cef6

Browse files
authored
Rename prevFrame into prevFrameContext (#447)
1 parent f02bd4f commit cd7cef6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/torchcodec/decoders/_core/VideoDecoder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class VideoDecoder {
342342
ColorConversionLibrary colorConversionLibrary = FILTERGRAPH;
343343
std::vector<FrameInfo> keyFrames;
344344
std::vector<FrameInfo> allFrames;
345-
DecodedFrameContext prevFrame;
345+
DecodedFrameContext prevFrameContext;
346346
UniqueSwsContext swsContext;
347347
};
348348
// Returns the key frame index of the presentation timestamp using FFMPEG's

0 commit comments

Comments
 (0)