We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 893c358 commit c35ae47Copy full SHA for c35ae47
src/torchcodec/decoders/_core/VideoDecoder.cpp
@@ -878,12 +878,9 @@ torch::Tensor VideoDecoder::getFramesPlayedInRangeAudio(
878
auto shouldStopDecoding = false;
879
while (!shouldStopDecoding) {
880
try {
881
- AVFrameStream avFrameStream =
882
- decodeAVFrame([&streamInfo](AVFrame* avFrame) {
883
- return (
884
- streamInfo.discardFramesBeforePts <
885
- avFrame->pts + getDuration(avFrame));
886
- });
+ AVFrameStream avFrameStream = decodeAVFrame([this](AVFrame* avFrame) {
+ return cursor_ < avFrame->pts + getDuration(avFrame);
+ });
887
auto frameOutput = convertAVFrameToFrameOutput(avFrameStream);
888
tensors.push_back(frameOutput.data);
889
} catch (const EndOfFileException& e) {
0 commit comments