Port NVIDIA Wave32 lowering, smooth movie-plane uploads, XMA audio fixes, and 32GB RAM residency budgets
This commit is contained in:
1 parent
45e90f4de8
commit
3bcc96f9bb
11 files changed
+463
-110
No files matched your search
@@ -517,7 +517,16 @@ fn pump(context: Context, voice: &mut Voice) {
|
||||
return;
|
||||
}
|
||||
while context.field(1, 31, 1) == 1 {
|
||||
if voice.pcm.len() < SAMPLES_PER_BLOCK && !decode(context, voice) {
|
||||
// A skipped frame or an input boundary can advance the decoder without
|
||||
// producing samples. Publish only complete blocks, except the final
|
||||
// padded tail. Limit empty steps so a broken looping voice cannot hold
|
||||
// its lock or stall other voices for the whole decoding pass.
|
||||
for _ in 0..8 {
|
||||
if voice.pcm.len() >= SAMPLES_PER_BLOCK || !decode(context, voice) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if voice.pcm.is_empty() || (voice.pcm.len() < SAMPLES_PER_BLOCK && !voice.ended) {
|
||||
return;
|
||||
}
|
||||
// The write block is the title's too: taken modulo the ring before
|
||||
@@ -549,12 +558,21 @@ fn pump(context: Context, voice: &mut Voice) {
|
||||
/// Decodes the next frame of the current input into `voice.pcm`; false
|
||||
/// when there is nothing left to decode.
|
||||
fn decode(context: Context, voice: &mut Voice) -> bool {
|
||||
let valid = context.field(0, 20, 2);
|
||||
if voice.ended {
|
||||
return false;
|
||||
// The title can refill either input while the context stays enabled.
|
||||
// Flush the previous tail once and leave the ring idle until a valid
|
||||
// buffer is published. The decoder resets its overlap when flushed.
|
||||
if valid == 0 {
|
||||
return false;
|
||||
}
|
||||
voice.ended = false;
|
||||
if context.field(2, 26, 5) == INPUT_INVALID {
|
||||
context.set_field(2, 26, 6, 0);
|
||||
}
|
||||
}
|
||||
let channels = context.channels();
|
||||
let mut current = context.field(4, 31, 1);
|
||||
let valid = context.field(0, 20, 2);
|
||||
if valid & (1 << current) == 0 {
|
||||
if valid & (1 << (1 - current)) == 0 {
|
||||
// Out of input: the overlap tail, then nothing.
|
||||
|
||||
Reference in new issue
Block a user