mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 11:33:06 +00:00
Only increment the ring index if data was successfully queued
This commit is contained in:
parent
8c9d0d171c
commit
eb15599c01
@ -46,7 +46,6 @@ public class AudioDepacketizer {
|
|||||||
else {
|
else {
|
||||||
pcmData = pcmRing[ringIndex];
|
pcmData = pcmRing[ringIndex];
|
||||||
decodeLen = OpusDecoder.decode(data, off, len, pcmData);
|
decodeLen = OpusDecoder.decode(data, off, len, pcmData);
|
||||||
ringIndex = (ringIndex + 1) % DU_LIMIT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decodeLen > 0) {
|
if (decodeLen > 0) {
|
||||||
@ -61,6 +60,10 @@ public class AudioDepacketizer {
|
|||||||
// Clear out the queue
|
// Clear out the queue
|
||||||
decodedUnits.clear();
|
decodedUnits.clear();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Frame successfully submitted for playback
|
||||||
|
ringIndex = (ringIndex + 1) % DU_LIMIT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user