mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Try more persistently to restart capture after an error occurred.
These can happen when changing resolution, or resuming from sleep.
This commit is contained in:
parent
0cd044df12
commit
3f53d0e2a0
@ -157,13 +157,9 @@ int DDAGrabber::grabFrame(Image<ColorRgb> &image)
|
||||
}
|
||||
|
||||
// Start the capture if it's not already running.
|
||||
if (!d->desktopDuplication)
|
||||
if (!d->desktopDuplication && !restartCapture())
|
||||
{
|
||||
if (!restartCapture())
|
||||
{
|
||||
setEnabled(false);
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
@ -179,11 +175,10 @@ int DDAGrabber::grabFrame(Image<ColorRgb> &image)
|
||||
CComPtr<IDXGIResource> desktopResource;
|
||||
DXGI_OUTDUPL_FRAME_INFO frameInfo;
|
||||
hr = d->desktopDuplication->AcquireNextFrame(INFINITE, &frameInfo, &desktopResource);
|
||||
if (hr == DXGI_ERROR_ACCESS_LOST)
|
||||
if (hr == DXGI_ERROR_ACCESS_LOST || hr == DXGI_ERROR_INVALID_CALL)
|
||||
{
|
||||
if (!restartCapture())
|
||||
{
|
||||
setEnabled(false);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user