Skip to content

Commit 79ea167

Browse files
committed
reduce diff
1 parent 793c876 commit 79ea167

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,6 @@ void VideoDecoder::addVideoStreamDecoder(
468468
}
469469
TORCH_CHECK(avCodec != nullptr);
470470

471-
StreamMetadata& streamMetadata =
472-
containerMetadata_.streamMetadatas[streamIndex];
473-
if (seekMode_ == SeekMode::approximate &&
474-
!streamMetadata.averageFps.has_value()) {
475-
throw std::runtime_error(
476-
"Seek mode is approximate, but stream " + std::to_string(streamIndex) +
477-
" does not have an average fps in its metadata.");
478-
}
479-
480471
StreamInfo& streamInfo = streamInfos_[streamIndex];
481472
streamInfo.streamIndex = streamIndex;
482473
streamInfo.timeBase = formatContext_->streams[streamIndex]->time_base;
@@ -495,6 +486,15 @@ void VideoDecoder::addVideoStreamDecoder(
495486
.value_or(avCodec));
496487
}
497488

489+
StreamMetadata& streamMetadata =
490+
containerMetadata_.streamMetadatas[streamIndex];
491+
if (seekMode_ == SeekMode::approximate &&
492+
!streamMetadata.averageFps.has_value()) {
493+
throw std::runtime_error(
494+
"Seek mode is approximate, but stream " + std::to_string(streamIndex) +
495+
" does not have an average fps in its metadata.");
496+
}
497+
498498
AVCodecContext* codecContext = avcodec_alloc_context3(avCodec);
499499
TORCH_CHECK(codecContext != nullptr);
500500
codecContext->thread_count = videoStreamOptions.ffmpegThreadCount.value_or(0);

0 commit comments

Comments
 (0)