libobs-d3d11: Allow rebuild even if output duplicator fails

Prevents an issue where the output duplicator would cause the program to
crash if the graphics driver crashes and the graphics subsystem needs to
be rebuilt.
master
jp9000 2017-11-16 20:33:03 -08:00
parent b9d044267d
commit e74a007718
2 changed files with 9 additions and 1 deletions

View File

@ -171,6 +171,10 @@ EXPORT bool gs_duplicator_update_frame(gs_duplicator_t *d)
ComPtr<IDXGIResource> res;
HRESULT hr;
if (!d->duplicator) {
return false;
}
hr = d->duplicator->AcquireNextFrame(0, &info, res.Assign());
if (hr == DXGI_ERROR_ACCESS_LOST) {
return false;

View File

@ -305,7 +305,11 @@ try {
((gs_pixel_shader*)obj)->Rebuild(dev);
break;
case gs_type::gs_duplicator:
((gs_duplicator*)obj)->Start();
try {
((gs_duplicator*)obj)->Start();
} catch (...) {
((gs_duplicator*)obj)->Release();
}
break;
case gs_type::gs_swap_chain:
((gs_swap_chain*)obj)->Rebuild(dev);