Skip to content

Commit bcb4e50

Browse files
committed
Merge branch 'main' of github.com:pytorch/torchcodec into pass_preallocated_tensors
2 parents 9387537 + c6a0a5a commit bcb4e50

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
@@ -1184,7 +1184,7 @@ VideoDecoder::RawDecodedOutput VideoDecoder::getNextRawDecodedOutputNoDemux() {
11841184
getDecodedOutputWithFilter([this](int frameStreamIndex, AVFrame* frame) {
11851185
StreamInfo& activeStream = streams_[frameStreamIndex];
11861186
return frame->pts >=
1187-
activeStream.discardFramesBeforePts.value_or(INT64_MIN);
1187+
activeStream.discardFramesBeforePts;
11881188
});
11891189
return rawOutput;
11901190
}

src/torchcodec/decoders/_core/VideoDecoder.h

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

0 commit comments

Comments
 (0)