Skip to content

Commit d725cbd

Browse files
committed
fix build on unix
1 parent 7580914 commit d725cbd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/core/libraries/ajm/ajm_aac.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,9 @@ DecoderResult AjmAacDecoder::ProcessData(std::span<u8>& input, SparseOutputBuffe
199199
return result;
200200
}
201201

202+
u32 AjmAacDecoder::GetNumChannels() const {
203+
const auto* const info = aacDecoder_GetStreamInfo(m_decoder);
204+
return u32(info->numChannels);
205+
}
206+
202207
} // namespace Libraries::Ajm

src/core/libraries/ajm/ajm_aac.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ struct AjmAacDecoder final : AjmCodec {
4646
u32 sampling_freq_type;
4747
};
4848

49+
u32 GetNumChannels() const;
50+
4951
template <class T>
5052
size_t WriteOutputSamples(SparseOutputBuffer& output, u32 skipped_samples, u32 max_samples) {
51-
const auto* const info = aacDecoder_GetStreamInfo(m_decoder);
5253
std::span<T> pcm_data{reinterpret_cast<T*>(m_pcm_buffer.data()),
5354
m_pcm_buffer.size() / sizeof(T)};
54-
pcm_data = pcm_data.subspan(skipped_samples * info->numChannels);
55+
pcm_data = pcm_data.subspan(skipped_samples * GetNumChannels());
5556
const auto pcm_size = std::min(u32(pcm_data.size()), max_samples);
5657
return output.Write(pcm_data.subspan(0, pcm_size));
5758
}

0 commit comments

Comments
 (0)