Skip to content

Commit 7a6e6ca

Browse files
committed
getNumFrames() should return optional in approximate mode
1 parent 04b2ead commit 7a6e6ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/torchcodec/_core/SingleStreamDecoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ std::optional<int64_t> SingleStreamDecoder::getNumFrames(
14871487
case SeekMode::exact:
14881488
return streamMetadata.numFramesFromScan.value();
14891489
case SeekMode::approximate: {
1490-
return streamMetadata.numFrames.value();
1490+
return streamMetadata.numFrames;
14911491
}
14921492
default:
14931493
throw std::runtime_error("Unknown SeekMode");

0 commit comments

Comments
 (0)