Skip to content

Commit 30f6898

Browse files
author
Clement Champetier
committed
AudioTransform: fix convert by indicate nbSamples instead of bufferSize
1 parent e887b1d commit 30f6898

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AvTranscoder/transform/AudioTransform.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ void AudioTransform::convert( const Frame& srcFrame, Frame& dstFrame )
101101

102102
int nbOutputSamplesPerChannel;
103103
#ifdef AV_RESAMPLE_LIBRARY
104-
nbOutputSamplesPerChannel = avresample_convert( _audioConvertContext, (uint8_t**)&dstData, 0, dstFrame.getSize(), (uint8_t**)&srcData, 0, srcFrame.getSize() );
104+
nbOutputSamplesPerChannel = avresample_convert( _audioConvertContext, (uint8_t**)&dstData, 0, _nbSamplesOfPreviousFrame, (uint8_t**)&srcData, 0, _nbSamplesOfPreviousFrame );
105105
#else
106-
nbOutputSamplesPerChannel = swr_convert( _audioConvertContext, &dstData, dstFrame.getSize(), &srcData, srcFrame.getSize() );
106+
nbOutputSamplesPerChannel = swr_convert( _audioConvertContext, &dstData, _nbSamplesOfPreviousFrame, &srcData, _nbSamplesOfPreviousFrame );
107107
#endif
108108

109109
if( nbOutputSamplesPerChannel < 0 )

0 commit comments

Comments
 (0)