Skip to content

Commit 9aeedb1

Browse files
author
Clement Champetier
committed
AudioProperties: refactored getBitRate method
Use class methods instead of manipulate the FFmpeg classes.
1 parent a1cc138 commit 9aeedb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AvTranscoder/properties/AudioProperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ size_t AudioProperties::getBitRate() const
129129

130130
// else get computed bit rate from our computation (warning: way to compute bit rate of PCM audio data)
131131
const int bitsPerSample = av_get_bits_per_sample(_codecContext->codec_id); // 0 if unknown for the given codec
132-
return _codecContext->sample_rate * _codecContext->channels * bitsPerSample;
132+
return getSampleRate() * getNbChannels() * bitsPerSample;
133133
}
134134

135135
size_t AudioProperties::getNbSamples() const

0 commit comments

Comments
 (0)