@@ -405,7 +405,8 @@ void SingleStreamDecoder::addStream(
405
405
streamInfo.timeBase = formatContext_->streams [activeStreamIndex_]->time_base ;
406
406
streamInfo.stream = formatContext_->streams [activeStreamIndex_];
407
407
streamInfo.avMediaType = mediaType;
408
- streamInfo.deviceInterface = createDeviceInterface (device);
408
+
409
+ deviceInterface = createDeviceInterface (device);
409
410
410
411
// This should never happen, checking just to be safe.
411
412
TORCH_CHECK (
@@ -417,10 +418,9 @@ void SingleStreamDecoder::addStream(
417
418
// TODO_CODE_QUALITY it's pretty meh to have a video-specific logic within
418
419
// addStream() which is supposed to be generic
419
420
if (mediaType == AVMEDIA_TYPE_VIDEO) {
420
- if (streamInfo. deviceInterface ) {
421
+ if (deviceInterface) {
421
422
avCodec = makeAVCodecOnlyUseForCallingAVFindBestStream (
422
- streamInfo.deviceInterface
423
- ->findCodec (streamInfo.stream ->codecpar ->codec_id )
423
+ deviceInterface->findCodec (streamInfo.stream ->codecpar ->codec_id )
424
424
.value_or (avCodec));
425
425
}
426
426
}
@@ -438,8 +438,8 @@ void SingleStreamDecoder::addStream(
438
438
439
439
// TODO_CODE_QUALITY same as above.
440
440
if (mediaType == AVMEDIA_TYPE_VIDEO) {
441
- if (streamInfo. deviceInterface ) {
442
- streamInfo. deviceInterface ->initializeContext (codecContext);
441
+ if (deviceInterface) {
442
+ deviceInterface->initializeContext (codecContext);
443
443
}
444
444
}
445
445
@@ -1210,11 +1210,11 @@ SingleStreamDecoder::convertAVFrameToFrameOutput(
1210
1210
formatContext_->streams [activeStreamIndex_]->time_base );
1211
1211
if (streamInfo.avMediaType == AVMEDIA_TYPE_AUDIO) {
1212
1212
convertAudioAVFrameToFrameOutputOnCPU (avFrame, frameOutput);
1213
- } else if (!streamInfo. deviceInterface ) {
1213
+ } else if (!deviceInterface) {
1214
1214
convertAVFrameToFrameOutputOnCPU (
1215
1215
avFrame, frameOutput, preAllocatedOutputTensor);
1216
- } else if (streamInfo. deviceInterface ) {
1217
- streamInfo. deviceInterface ->convertAVFrameToFrameOutput (
1216
+ } else if (deviceInterface) {
1217
+ deviceInterface->convertAVFrameToFrameOutput (
1218
1218
streamInfo.videoStreamOptions ,
1219
1219
avFrame,
1220
1220
frameOutput,
0 commit comments