Skip to content

Commit 3966b94

Browse files
committed
correct merge changes
1 parent 314c3cd commit 3966b94

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/torchcodec/_core/SingleStreamDecoder.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,10 +1490,7 @@ std::optional<int64_t> SingleStreamDecoder::getNumFrames(
14901490
case SeekMode::exact:
14911491
return streamMetadata.numFramesFromContent.value();
14921492
case SeekMode::approximate: {
1493-
TORCH_CHECK(
1494-
streamMetadata.numFramesFromHeader.has_value(),
1495-
"Cannot use approximate mode since we couldn't find the number of frames from the metadata.");
1496-
return streamMetadata.numFramesFromHeader.value();
1493+
return streamMetadata.numFramesFromHeader;
14971494
}
14981495
default:
14991496
throw std::runtime_error("Unknown SeekMode");
@@ -1518,10 +1515,7 @@ std::optional<double> SingleStreamDecoder::getMaxSeconds(
15181515
case SeekMode::exact:
15191516
return streamMetadata.endStreamPtsSecondsFromContent.value();
15201517
case SeekMode::approximate: {
1521-
TORCH_CHECK(
1522-
streamMetadata.durationSecondsFromHeader.has_value(),
1523-
"Cannot use approximate mode since we couldn't find the duration from the metadata.");
1524-
return streamMetadata.durationSecondsFromHeader.value();
1518+
return streamMetadata.durationSecondsFromHeader;
15251519
}
15261520
default:
15271521
throw std::runtime_error("Unknown SeekMode");

0 commit comments

Comments
 (0)