summaryrefslogtreecommitdiffstats
path: root/dom/media/AudioSegment.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/media/AudioSegment.h
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/AudioSegment.h')
-rw-r--r--dom/media/AudioSegment.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/dom/media/AudioSegment.h b/dom/media/AudioSegment.h
index 006f996c39..7d60bf7ca5 100644
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -79,7 +79,8 @@ static void InterleaveAndConvertBuffer(const SrcT* const* aSourceChannels,
DestT* output = aOutput;
for (size_t i = 0; i < aLength; ++i) {
for (size_t channel = 0; channel < aChannels; ++channel) {
- float v = AudioSampleToFloat(aSourceChannels[channel][i]) * aVolume;
+ float v =
+ ConvertAudioSample<float>(aSourceChannels[channel][i]) * aVolume;
*output = FloatToAudioSample<DestT>(v);
++output;
}
@@ -93,7 +94,8 @@ static void DeinterleaveAndConvertBuffer(const SrcT* aSourceBuffer,
for (size_t i = 0; i < aChannels; i++) {
size_t interleavedIndex = i;
for (size_t j = 0; j < aFrames; j++) {
- ConvertAudioSample(aSourceBuffer[interleavedIndex], aOutput[i][j]);
+ aOutput[i][j] =
+ ConvertAudioSample<DestT>(aSourceBuffer[interleavedIndex]);
interleavedIndex += aChannels;
}
}
@@ -148,7 +150,7 @@ void DownmixAndInterleave(Span<const SrcT* const> aChannelData,
* separate pointers to each channel's buffer.
*/
struct AudioChunk {
- typedef mozilla::AudioSampleFormat SampleFormat;
+ using SampleFormat = mozilla::AudioSampleFormat;
AudioChunk() = default;
@@ -318,7 +320,7 @@ struct AudioChunk {
* A list of audio samples consisting of a sequence of slices of SharedBuffers.
* The audio rate is determined by the track, not stored in this class.
*/
-class AudioSegment : public MediaSegmentBase<AudioSegment, AudioChunk> {
+class AudioSegment final : public MediaSegmentBase<AudioSegment, AudioChunk> {
// The channel count that MaxChannelCount() returned last time it was called.
uint32_t mMemoizedMaxChannelCount = 0;