Skip to content

Commit ca15232

Browse files
committed
Driveby, remove preAllocatedOutputTensor
1 parent db740a6 commit ca15232

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,8 +1170,7 @@ VideoDecoder::FrameOutput VideoDecoder::convertAVFrameToFrameOutput(
11701170
getDuration(avFrame),
11711171
formatContext_->streams[activeStreamIndex_]->time_base);
11721172
if (streamInfo.avMediaType == AVMEDIA_TYPE_AUDIO) {
1173-
convertAudioAVFrameToFrameOutputOnCPU(
1174-
avFrame, frameOutput, preAllocatedOutputTensor);
1173+
convertAudioAVFrameToFrameOutputOnCPU(avFrame, frameOutput);
11751174
} else if (streamInfo.videoStreamOptions.device.type() == torch::kCPU) {
11761175
convertAVFrameToFrameOutputOnCPU(
11771176
avFrame, frameOutput, preAllocatedOutputTensor);
@@ -1349,11 +1348,7 @@ torch::Tensor VideoDecoder::convertAVFrameToTensorUsingFilterGraph(
13491348

13501349
void VideoDecoder::convertAudioAVFrameToFrameOutputOnCPU(
13511350
UniqueAVFrame& srcAVFrame,
1352-
FrameOutput& frameOutput,
1353-
std::optional<torch::Tensor> preAllocatedOutputTensor) {
1354-
TORCH_CHECK(
1355-
!preAllocatedOutputTensor.has_value(),
1356-
"pre-allocated audio tensor not supported yet.");
1351+
FrameOutput& frameOutput) {
13571352

13581353
AVSampleFormat sourceSampleFormat =
13591354
static_cast<AVSampleFormat>(srcAVFrame->format);

src/torchcodec/decoders/_core/VideoDecoder.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,7 @@ class VideoDecoder {
391391

392392
void convertAudioAVFrameToFrameOutputOnCPU(
393393
UniqueAVFrame& srcAVFrame,
394-
FrameOutput& frameOutput,
395-
std::optional<torch::Tensor> preAllocatedOutputTensor = std::nullopt);
394+
FrameOutput& frameOutput);
396395

397396
torch::Tensor convertAVFrameToTensorUsingFilterGraph(
398397
const UniqueAVFrame& avFrame);

0 commit comments

Comments
 (0)