fix(AVSB): black screen when turning screen off and on
This commit is contained in:
1 parent
02ede90d77
commit
f6032969c3
2 files changed
+13
-21
No files matched your search
@@ -213,8 +213,9 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
|||||||
|
|
||||||
// Recreate the display layer. We are already on the main thread,
|
// Recreate the display layer. We are already on the main thread,
|
||||||
// so this is safe to do right here.
|
// so this is safe to do right here.
|
||||||
|
[self->_displayLayer flushAndRemoveImage];
|
||||||
[self reinitializeDisplayLayer];
|
[self reinitializeDisplayLayer];
|
||||||
|
|
||||||
// Request an IDR frame to initialize the new decoder
|
// Request an IDR frame to initialize the new decoder
|
||||||
LiRequestIdrFrame();
|
LiRequestIdrFrame();
|
||||||
}
|
}
|
||||||
@@ -729,21 +730,6 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
return DR_NEED_IDR;
|
return DR_NEED_IDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for previous decoder errors before doing anything
|
|
||||||
if (_displayLayer.status == AVQueuedSampleBufferRenderingStatusFailed) {
|
|
||||||
Log(LOG_E, @"Display layer rendering failed: %@", _displayLayer.error);
|
|
||||||
|
|
||||||
[self->_displayLayer flushAndRemoveImage];
|
|
||||||
|
|
||||||
// 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);
|
|
||||||
return DR_NEED_IDR;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now we're decoding actual frame data here
|
// Now we're decoding actual frame data here
|
||||||
CMBlockBufferRef frameBlockBuffer;
|
CMBlockBufferRef frameBlockBuffer;
|
||||||
CMBlockBufferRef dataBlockBuffer;
|
CMBlockBufferRef dataBlockBuffer;
|
||||||
@@ -909,7 +895,16 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
if (status != noErr || !imageBuffer) {
|
if (status != noErr || !imageBuffer) {
|
||||||
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil];
|
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil];
|
||||||
Log(LOG_E, @"Decompression session error: %@", error);
|
Log(LOG_E, @"Decompression session error: %@", error);
|
||||||
LiRequestIdrFrame();
|
if (status == kVTInvalidSessionErr) {
|
||||||
|
// The session was invalidated by the OS. Destroy our reference
|
||||||
|
// so it gets recreated on the next IDR frame.
|
||||||
|
if (self->_decompressionSession) {
|
||||||
|
VTDecompressionSessionInvalidate(self->_decompressionSession);
|
||||||
|
CFRelease(self->_decompressionSession);
|
||||||
|
self->_decompressionSession = nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LiRequestIdrFrame(); // Request an IDR to restart the stream
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -929,10 +929,7 @@
|
|||||||
[self.pipController stopPictureInPicture];
|
[self.pipController stopPictureInPicture];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_isRestoringFromPiP) {
|
[self->_streamMan.videoRenderer resetFramePacing];
|
||||||
[self->_streamMan.videoRenderer resetFramePacing];
|
|
||||||
}
|
|
||||||
|
|
||||||
_isRestoringFromPiP = NO;
|
_isRestoringFromPiP = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user