mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 06:01:13 +00:00
Fix crash during display layer reinitialization
This commit is contained in:
@@ -311,13 +311,9 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
if (displayLayer.status == AVQueuedSampleBufferRenderingStatusFailed) {
|
if (displayLayer.status == AVQueuedSampleBufferRenderingStatusFailed) {
|
||||||
Log(LOG_E, @"Display layer rendering failed: %@", displayLayer.error);
|
Log(LOG_E, @"Display layer rendering failed: %@", displayLayer.error);
|
||||||
|
|
||||||
// Recreate the display layer on the main thread.
|
// Recreate the display layer. We are already on the main thread,
|
||||||
// We need to use dispatch_sync() or we may miss
|
// so this is safe to do right here.
|
||||||
// some parameter sets while the layer is being
|
[self reinitializeDisplayLayer];
|
||||||
// recreated.
|
|
||||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
|
||||||
[self reinitializeDisplayLayer];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Request an IDR frame to initialize the new decoder
|
// Request an IDR frame to initialize the new decoder
|
||||||
free(data);
|
free(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user