mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix deadlocks in audio and video stream shutdown using the new callbacks
This commit is contained in:
parent
83141d3f91
commit
8962497a8c
@ -84,10 +84,18 @@ public class AndroidAudioRenderer implements AudioRenderer {
|
||||
track.write(audioData, 0, audioData.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
// Immediately drop all pending data
|
||||
track.pause();
|
||||
track.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup() {
|
||||
if (track != null) {
|
||||
track.release();
|
||||
}
|
||||
track.release();
|
||||
}
|
||||
}
|
||||
|
@ -260,8 +260,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
return -5;
|
||||
}
|
||||
|
||||
startRendererThread();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -380,26 +378,25 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
return index;
|
||||
}
|
||||
|
||||
// This method is used by the hack in Game, not called by the streaming core.
|
||||
@Override
|
||||
public void start() {
|
||||
startRendererThread();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
stopping = true;
|
||||
|
||||
if (rendererThread != null) {
|
||||
// Halt the rendering thread
|
||||
rendererThread.interrupt();
|
||||
try {
|
||||
rendererThread.join();
|
||||
} catch (InterruptedException ignored) { }
|
||||
}
|
||||
// Halt the rendering thread
|
||||
rendererThread.interrupt();
|
||||
try {
|
||||
rendererThread.join();
|
||||
} catch (InterruptedException ignored) { }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup() {
|
||||
stop();
|
||||
|
||||
if (videoDecoder != null) {
|
||||
videoDecoder.release();
|
||||
}
|
||||
videoDecoder.release();
|
||||
}
|
||||
|
||||
private boolean queueInputBuffer(int inputBufferIndex, int offset, int length, long timestampUs, int codecFlags) {
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 525a8ac322129ee54d674da5d0a3518f6f56ef64
|
||||
Subproject commit 4c2dc16aefbb516da42399c0fb06bff19a2629e6
|
Loading…
x
Reference in New Issue
Block a user