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 8ed3c5e commit bc10db8Copy full SHA for bc10db8
src/torchcodec/decoders/_core/VideoDecoder.cpp
@@ -600,7 +600,9 @@ void VideoDecoder::scanFileAndUpdateMetadataAndIndex() {
600
streamMetadata.maxPtsFromScan.value_or(INT64_MIN),
601
packet->pts + packet->duration);
602
603
- FrameInfo frameInfo{.pts = packet->pts};
+ // Note that we set the other value in this struct, nextPts, only after
604
+ // we have scanned all packets and sorted by pts.
605
+ FrameInfo frameInfo = {.pts = packet->pts};
606
if (packet->flags & AV_PKT_FLAG_KEY) {
607
streams_[streamIndex].keyFrames.push_back(frameInfo);
608
}
0 commit comments