Skip to content

Commit c35ae47

Browse files
committed
Fix
1 parent 893c358 commit c35ae47

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -878,12 +878,9 @@ torch::Tensor VideoDecoder::getFramesPlayedInRangeAudio(
878878
auto shouldStopDecoding = false;
879879
while (!shouldStopDecoding) {
880880
try {
881-
AVFrameStream avFrameStream =
882-
decodeAVFrame([&streamInfo](AVFrame* avFrame) {
883-
return (
884-
streamInfo.discardFramesBeforePts <
885-
avFrame->pts + getDuration(avFrame));
886-
});
881+
AVFrameStream avFrameStream = decodeAVFrame([this](AVFrame* avFrame) {
882+
return cursor_ < avFrame->pts + getDuration(avFrame);
883+
});
887884
auto frameOutput = convertAVFrameToFrameOutput(avFrameStream);
888885
tensors.push_back(frameOutput.data);
889886
} catch (const EndOfFileException& e) {

0 commit comments

Comments
 (0)