@@ -1399,7 +1399,7 @@ void VideoDecoder::convertAudioAVFrameToFrameOutputOnCPU(
1399
1399
}
1400
1400
1401
1401
UniqueAVFrame VideoDecoder::convertAudioAVFrameSampleFormatAndSampleRate (
1402
- const UniqueAVFrame& avFrame ,
1402
+ const UniqueAVFrame& srcAVFrame ,
1403
1403
AVSampleFormat sourceSampleFormat,
1404
1404
AVSampleFormat desiredSampleFormat,
1405
1405
int sourceSampleRate,
@@ -1420,7 +1420,7 @@ UniqueAVFrame VideoDecoder::convertAudioAVFrameSampleFormatAndSampleRate(
1420
1420
convertedAVFrame,
1421
1421
" Could not allocate frame for sample format conversion." );
1422
1422
1423
- setChannelLayout (convertedAVFrame, avFrame );
1423
+ setChannelLayout (convertedAVFrame, srcAVFrame );
1424
1424
convertedAVFrame->format = static_cast <int >(desiredSampleFormat);
1425
1425
convertedAVFrame->sample_rate = desiredSampleRate;
1426
1426
if (sourceSampleRate != desiredSampleRate) {
@@ -1431,12 +1431,12 @@ UniqueAVFrame VideoDecoder::convertAudioAVFrameSampleFormatAndSampleRate(
1431
1431
// `swr_convert()`.
1432
1432
convertedAVFrame->nb_samples = av_rescale_rnd (
1433
1433
swr_get_delay (streamInfo.swrContext .get (), sourceSampleRate) +
1434
- avFrame ->nb_samples ,
1434
+ srcAVFrame ->nb_samples ,
1435
1435
desiredSampleRate,
1436
1436
sourceSampleRate,
1437
1437
AV_ROUND_UP);
1438
1438
} else {
1439
- convertedAVFrame->nb_samples = avFrame ->nb_samples ;
1439
+ convertedAVFrame->nb_samples = srcAVFrame ->nb_samples ;
1440
1440
}
1441
1441
1442
1442
auto status = av_frame_get_buffer (convertedAVFrame.get (), 0 );
@@ -1449,8 +1449,8 @@ UniqueAVFrame VideoDecoder::convertAudioAVFrameSampleFormatAndSampleRate(
1449
1449
streamInfo.swrContext .get (),
1450
1450
convertedAVFrame->data ,
1451
1451
convertedAVFrame->nb_samples ,
1452
- static_cast <const uint8_t **>(const_cast <const uint8_t **>(avFrame ->data )),
1453
- avFrame ->nb_samples );
1452
+ static_cast <const uint8_t **>(const_cast <const uint8_t **>(srcAVFrame ->data )),
1453
+ srcAVFrame ->nb_samples );
1454
1454
TORCH_CHECK (
1455
1455
numConvertedSamples > 0 ,
1456
1456
" Error in swr_convert: " ,
0 commit comments