again fixed crash with start recording

This commit is contained in:
jojo61 2018-10-11 19:47:38 +02:00
parent e28a865f1c
commit 961332309c
1 changed files with 7 additions and 6 deletions

13
video.c
View File

@ -1764,12 +1764,13 @@ static void CuvidDestroySurfaces(CuvidDecoder * decoder)
glXMakeCurrent(XlibDisplay, VideoWindow, GlxContext);
GlxCheck();
for (i=0;i<decoder->SurfacesNeeded;i++) {
for (j=0;j<2;j++) {
if (decoder->cu_res[i][j]) {
checkCudaErrors(cuGraphicsUnregisterResource(decoder->cu_res[i][j]));
decoder->cu_res[i][j] = 0;
if (decoder->cuda_ctx) {
for (i=0;i<decoder->SurfacesNeeded;i++) {
for (j=0;j<2;j++) {
if (decoder->cu_res[i][j]) {
checkCudaErrors(cuGraphicsUnregisterResource(decoder->cu_res[i][j]));
decoder->cu_res[i][j] = 0;
}
}
}
}