mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-27 06:32:59 +00:00
Replace the old sublayer rather than adding the new one on top of the onscreen controls
This commit is contained in:
parent
d92edc19df
commit
de4ed222cd
@ -22,9 +22,7 @@
|
||||
|
||||
- (void)reinitializeDisplayLayer
|
||||
{
|
||||
if (displayLayer != nil) {
|
||||
[displayLayer removeFromSuperlayer];
|
||||
}
|
||||
CALayer *oldLayer = displayLayer;
|
||||
|
||||
displayLayer = [[AVSampleBufferDisplayLayer alloc] init];
|
||||
displayLayer.bounds = _view.bounds;
|
||||
@ -32,7 +30,13 @@
|
||||
displayLayer.position = CGPointMake(CGRectGetMidX(_view.bounds), CGRectGetMidY(_view.bounds));
|
||||
displayLayer.videoGravity = AVLayerVideoGravityResizeAspect;
|
||||
|
||||
[_view.layer addSublayer:displayLayer];
|
||||
if (oldLayer != nil) {
|
||||
// Switch out the old display layer with the new one
|
||||
[_view.layer replaceSublayer:oldLayer with:displayLayer];
|
||||
}
|
||||
else {
|
||||
[_view.layer addSublayer:displayLayer];
|
||||
}
|
||||
|
||||
// We need some parameter sets before we can properly start decoding frames
|
||||
waitingForSps = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user