mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-05 07:26:28 +00:00
Fix frame drops when stopping the stream
This commit is contained in:
@@ -969,7 +969,17 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
private void stopConnection() {
|
private void stopConnection() {
|
||||||
if (connecting || connected) {
|
if (connecting || connected) {
|
||||||
connecting = connected = false;
|
connecting = connected = false;
|
||||||
conn.stop();
|
|
||||||
|
// Stop may take a few hundred ms to do some network I/O to tell
|
||||||
|
// the server we're going away and clean up. Let it run in a separate
|
||||||
|
// thread to keep things smooth for the UI. Inside moonlight-common,
|
||||||
|
// we prevent another thread from starting a connection before and
|
||||||
|
// during the process of stopping this one.
|
||||||
|
new Thread() {
|
||||||
|
public void run() {
|
||||||
|
conn.stop();
|
||||||
|
}
|
||||||
|
}.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Submodule moonlight-common updated: 83423959a1...a5a402981f
Reference in New Issue
Block a user