Skip to content

Commit 3d9f864

Browse files
committed
Add TORCH_CHECK for stream type
1 parent c11024f commit 3d9f864

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ VideoDecoder::DecodedOutput VideoDecoder::convertAVFrameToDecodedOutput(
869869
AVFrame* frame = rawOutput.frame.get();
870870
output.streamIndex = streamIndex;
871871
auto& streamInfo = streams_[streamIndex];
872+
TORCH_CHECK(streamInfo.stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO);
872873
output.pts = frame->pts;
873874
output.ptsSeconds =
874875
ptsToSeconds(frame->pts, formatContext_->streams[streamIndex]->time_base);

0 commit comments

Comments
 (0)