Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary optionality #271

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/torchcodec/decoders/_core/VideoDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ VideoDecoder::RawDecodedOutput VideoDecoder::getNextRawDecodedOutputNoDemux() {
getDecodedOutputWithFilter([this](int frameStreamIndex, AVFrame* frame) {
StreamInfo& activeStream = streams_[frameStreamIndex];
return frame->pts >=
activeStream.discardFramesBeforePts.value_or(INT64_MIN);
activeStream.discardFramesBeforePts;
});
return rawOutput;
}
Expand Down
4 changes: 2 additions & 2 deletions src/torchcodec/decoders/_core/VideoDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ class VideoDecoder {
int64_t currentDuration = 0;
// The desired position of the cursor in the stream. We send frames >=
// this pts to the user when they request a frame.
// We set this field if the user requested a seek.
std::optional<int64_t> discardFramesBeforePts = 0;
// We update this field if the user requested a seek.
int64_t discardFramesBeforePts = INT64_MIN;
VideoStreamDecoderOptions options;
// The filter state associated with this stream (for video streams). The
// actual graph will be nullptr for inactive streams.
Expand Down
Loading