Skip to content

Commit 186be2d

Browse files
authored
Avoid shadowing local variables (#688)
1 parent cb9998f commit 186be2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/torchcodec/_core/SingleStreamDecoder.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -630,15 +630,15 @@ FrameBatchOutput SingleStreamDecoder::getFramesInRange(
630630
FrameOutput SingleStreamDecoder::getFramePlayedAt(double seconds) {
631631
validateActiveStream(AVMEDIA_TYPE_VIDEO);
632632
StreamInfo& streamInfo = streamInfos_[activeStreamIndex_];
633-
double frameStartTime =
633+
double lastDecodedStartTime =
634634
ptsToSeconds(streamInfo.lastDecodedAvFramePts, streamInfo.timeBase);
635-
double frameEndTime = ptsToSeconds(
635+
double lastDecodedEndTime = ptsToSeconds(
636636
streamInfo.lastDecodedAvFramePts + streamInfo.lastDecodedAvFrameDuration,
637637
streamInfo.timeBase);
638-
if (seconds >= frameStartTime && seconds < frameEndTime) {
638+
if (seconds >= lastDecodedStartTime && seconds < lastDecodedEndTime) {
639639
// We are in the same frame as the one we just returned. However, since we
640640
// don't cache it locally, we have to rewind back.
641-
seconds = frameStartTime;
641+
seconds = lastDecodedStartTime;
642642
}
643643

644644
setCursorPtsInSeconds(seconds);

0 commit comments

Comments
 (0)