Skip to content

Commit 8e0b756

Browse files
committed
Remove re-setting of metadata
1 parent 84fd7a5 commit 8e0b756

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

src/torchcodec/_core/SingleStreamDecoder.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -524,15 +524,6 @@ void SingleStreamDecoder::addVideoStream(
524524
auto& streamInfo = streamInfos_[activeStreamIndex_];
525525
streamInfo.videoStreamOptions = videoStreamOptions;
526526

527-
// This metadata was already set in initializeDecoder() from the
528-
// AVCodecParameters that are part of the AVStream. But we consider the
529-
// AVCodecContext to be more authoritative, so we use that for our decoding
530-
// stream.
531-
streamMetadata.width = streamInfo.codecContext->width;
532-
streamMetadata.height = streamInfo.codecContext->height;
533-
streamMetadata.sampleAspectRatio =
534-
streamInfo.codecContext->sample_aspect_ratio;
535-
536527
if (seekMode_ == SeekMode::custom_frame_mappings) {
537528
TORCH_CHECK(
538529
customFrameMappings.has_value(),
@@ -578,18 +569,6 @@ void SingleStreamDecoder::addAudioStream(
578569
auto& streamInfo = streamInfos_[activeStreamIndex_];
579570
streamInfo.audioStreamOptions = audioStreamOptions;
580571

581-
auto& streamMetadata =
582-
containerMetadata_.allStreamMetadata[activeStreamIndex_];
583-
584-
// This metadata was already set in initializeDecoder() from the
585-
// AVCodecParameters that are part of the AVStream. But we consider the
586-
// AVCodecContext to be more authoritative, so we use that for our decoding
587-
// stream.
588-
streamMetadata.sampleRate =
589-
static_cast<int64_t>(streamInfo.codecContext->sample_rate);
590-
streamMetadata.numChannels =
591-
static_cast<int64_t>(getNumChannels(streamInfo.codecContext));
592-
593572
// FFmpeg docs say that the decoder will try to decode natively in this
594573
// format, if it can. Docs don't say what the decoder does when it doesn't
595574
// support that format, but it looks like it does nothing, so this probably

0 commit comments

Comments
 (0)