mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-30 03:04:17 +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) {
|
||||
std::scoped_lock lock(bufferLock);
|
||||
|
||||
size_t size{(channelCount == constant::SurroundChannelCount) ? (buffer.size() / sizeof(Surround51Sample)) * sizeof(StereoSample) : buffer.size()};
|
||||
BufferIdentifier identifier{
|
||||
.released = false,
|
||||
.tag = tag,
|
||||
.finalSample = identifiers.empty() ? (buffer.size()) : (buffer.size() + identifiers.front().finalSample)
|
||||
.finalSample = identifiers.empty() ? size : (size + identifiers.front().finalSample)
|
||||
};
|
||||
|
||||
identifiers.push_front(identifier);
|
||||
|
Loading…
Reference in New Issue
Block a user