mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-18 18:42:46 +00:00
Improve low bandwidth audio performance and fix RTSP issues with broken PMTUD
This commit is contained in:
parent
c025432ad6
commit
5f5944c237
@ -170,14 +170,14 @@ public class AndroidAudioRenderer implements AudioRenderer {
|
|||||||
@Override
|
@Override
|
||||||
public void playDecodedAudio(short[] audioData) {
|
public void playDecodedAudio(short[] audioData) {
|
||||||
// Only queue up to 40 ms of pending audio data in addition to what AudioTrack is buffering for us.
|
// Only queue up to 40 ms of pending audio data in addition to what AudioTrack is buffering for us.
|
||||||
if (MoonBridge.getPendingAudioFrames() < 8) {
|
if (MoonBridge.getPendingAudioDuration() < 40) {
|
||||||
// This will block until the write is completed. That can cause a backlog
|
// This will block until the write is completed. That can cause a backlog
|
||||||
// of pending audio data, so we do the above check to be able to bound
|
// of pending audio data, so we do the above check to be able to bound
|
||||||
// latency at 40 ms in that situation.
|
// latency at 40 ms in that situation.
|
||||||
track.write(audioData, 0, audioData.length);
|
track.write(audioData, 0, audioData.length);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LimeLog.info("Too many pending audio frames: " + MoonBridge.getPendingAudioFrames());
|
LimeLog.info("Too much pending audio data: " + MoonBridge.getPendingAudioDuration() +" ms");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ public class MoonBridge {
|
|||||||
|
|
||||||
public static native String findExternalAddressIP4(String stunHostName, int stunPort);
|
public static native String findExternalAddressIP4(String stunHostName, int stunPort);
|
||||||
|
|
||||||
public static native int getPendingAudioFrames();
|
public static native int getPendingAudioDuration();
|
||||||
|
|
||||||
public static native int getPendingVideoFrames();
|
public static native int getPendingVideoFrames();
|
||||||
|
|
||||||
|
@ -382,6 +382,7 @@ static AUDIO_RENDERER_CALLBACKS BridgeAudioRendererCallbacks = {
|
|||||||
.stop = BridgeArStop,
|
.stop = BridgeArStop,
|
||||||
.cleanup = BridgeArCleanup,
|
.cleanup = BridgeArCleanup,
|
||||||
.decodeAndPlaySample = BridgeArDecodeAndPlaySample,
|
.decodeAndPlaySample = BridgeArDecodeAndPlaySample,
|
||||||
|
.capabilities = CAPABILITY_SUPPORTS_ARBITRARY_AUDIO_DURATION
|
||||||
};
|
};
|
||||||
|
|
||||||
static CONNECTION_LISTENER_CALLBACKS BridgeConnListenerCallbacks = {
|
static CONNECTION_LISTENER_CALLBACKS BridgeConnListenerCallbacks = {
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 9bd301897aa5329aafea203885398bc3dcb19d94
|
Subproject commit c1a26618d48d436657e47bcd38c2487d318c9fa0
|
@ -83,8 +83,8 @@ Java_com_limelight_nvstream_jni_MoonBridge_findExternalAddressIP4(JNIEnv *env, j
|
|||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL
|
JNIEXPORT jint JNICALL
|
||||||
Java_com_limelight_nvstream_jni_MoonBridge_getPendingAudioFrames(JNIEnv *env, jclass clazz) {
|
Java_com_limelight_nvstream_jni_MoonBridge_getPendingAudioDuration(JNIEnv *env, jclass clazz) {
|
||||||
return LiGetPendingAudioFrames();
|
return LiGetPendingAudioDuration();
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL
|
JNIEXPORT jint JNICALL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user