Skip to content

Commit c6a0a5a

Browse files
authored
Remove unnecessary optionality (#271)
1 parent f8cbb62 commit c6a0a5a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ VideoDecoder::RawDecodedOutput VideoDecoder::getNextRawDecodedOutputNoDemux() {
11681168
getDecodedOutputWithFilter([this](int frameStreamIndex, AVFrame* frame) {
11691169
StreamInfo& activeStream = streams_[frameStreamIndex];
11701170
return frame->pts >=
1171-
activeStream.discardFramesBeforePts.value_or(INT64_MIN);
1171+
activeStream.discardFramesBeforePts;
11721172
});
11731173
return rawOutput;
11741174
}

src/torchcodec/decoders/_core/VideoDecoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ class VideoDecoder {
307307
int64_t currentDuration = 0;
308308
// The desired position of the cursor in the stream. We send frames >=
309309
// this pts to the user when they request a frame.
310-
// We set this field if the user requested a seek.
311-
std::optional<int64_t> discardFramesBeforePts = 0;
310+
// We update this field if the user requested a seek.
311+
int64_t discardFramesBeforePts = INT64_MIN;
312312
VideoStreamDecoderOptions options;
313313
// The filter state associated with this stream (for video streams). The
314314
// actual graph will be nullptr for inactive streams.

0 commit comments

Comments
 (0)