Skip to content

Commit 59755cc

Browse files
author
Valentin Noel
committed
Transcoding: in AudioTransform, reset previous processed audio frame size attribute only when the current frame size is re-initialized
1 parent 96bf6fe commit 59755cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AvTranscoder/transform/AudioTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ bool AudioTransform::initFrames( const Frame& srcFrame, Frame& dstFrame )
7272

7373
int dstSampleSize = av_get_bytes_per_sample( dst.desc().getAVSampleFormat() );
7474
dstFrame.getBuffer().resize( src.getNbSamples() * dstSampleSize );
75+
_previousProcessedAudioFrameSize = srcFrame.getSize();
7576
return true;
7677
}
7778

@@ -103,7 +104,6 @@ void AudioTransform::convert( const Frame& srcFrame, Frame& dstFrame )
103104
if( dstFrame.getSize() != nbOutputSamples )
104105
dstFrame.getBuffer().resize( nbOutputSamples, 0 );
105106
static_cast<AudioFrame&>( dstFrame ).setNbSamples( static_cast<const AudioFrame&>( srcFrame ).getNbSamples() );
106-
_previousProcessedAudioFrameSize = srcFrame.getSize();
107107
}
108108

109109
}

0 commit comments

Comments
 (0)