Fix crash during display layer reinitialization
This commit is contained in:
parent
9ea5e2ec99
commit
3b0d80bce2
1 changed files with 3 additions and 7 deletions
|
|
@ -311,13 +311,9 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||
if (displayLayer.status == AVQueuedSampleBufferRenderingStatusFailed) {
|
||||
Log(LOG_E, @"Display layer rendering failed: %@", displayLayer.error);
|
||||
|
||||
// Recreate the display layer on the main thread.
|
||||
// We need to use dispatch_sync() or we may miss
|
||||
// some parameter sets while the layer is being
|
||||
// recreated.
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[self reinitializeDisplayLayer];
|
||||
});
|
||||
// Recreate the display layer. We are already on the main thread,
|
||||
// so this is safe to do right here.
|
||||
[self reinitializeDisplayLayer];
|
||||
|
||||
// Request an IDR frame to initialize the new decoder
|
||||
free(data);
|
||||
|
|
|
|||
Loading…
Reference in a new issue