mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-30 04:44:15 +01:00
Correctly track 5.1 audio channel sample count
Size needs to be adjusted for 5.1 buffers since they're downsampled to stereo.
This commit is contained in:
parent
56c9b03843
commit
622ff2a8f1
@ -58,10 +58,11 @@ namespace skyline::audio {
|
|||||||
void AudioTrack::AppendBuffer(u64 tag, span<i16> buffer) {
|
void AudioTrack::AppendBuffer(u64 tag, span<i16> buffer) {
|
||||||
std::scoped_lock lock(bufferLock);
|
std::scoped_lock lock(bufferLock);
|
||||||
|
|
||||||
|
size_t size{(channelCount == constant::SurroundChannelCount) ? (buffer.size() / sizeof(Surround51Sample)) * sizeof(StereoSample) : buffer.size()};
|
||||||
BufferIdentifier identifier{
|
BufferIdentifier identifier{
|
||||||
.released = false,
|
.released = false,
|
||||||
.tag = tag,
|
.tag = tag,
|
||||||
.finalSample = identifiers.empty() ? (buffer.size()) : (buffer.size() + identifiers.front().finalSample)
|
.finalSample = identifiers.empty() ? size : (size + identifiers.front().finalSample)
|
||||||
};
|
};
|
||||||
|
|
||||||
identifiers.push_front(identifier);
|
identifiers.push_front(identifier);
|
||||||
|
Loading…
Reference in New Issue
Block a user