mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-30 13:58:08 +00:00
Do not call codec.stop() on exception
On exception, the codec is not in a state were .stop() can be called.
This commit is contained in:
@@ -71,8 +71,9 @@ public class ScreenEncoder implements Device.RotationListener {
|
|||||||
codec.start();
|
codec.start();
|
||||||
try {
|
try {
|
||||||
alive = encode(codec, fd);
|
alive = encode(codec, fd);
|
||||||
} finally {
|
// do not call stop() on exception, it would trigger an IllegalStateException
|
||||||
codec.stop();
|
codec.stop();
|
||||||
|
} finally {
|
||||||
destroyDisplay(display);
|
destroyDisplay(display);
|
||||||
codec.release();
|
codec.release();
|
||||||
surface.release();
|
surface.release();
|
||||||
|
Reference in New Issue
Block a user