fixed crash with start recording

This commit is contained in:
jojo61 2018-10-11 17:37:59 +02:00
parent 1640642664
commit e28a865f1c

View File

@ -1767,7 +1767,10 @@ static void CuvidDestroySurfaces(CuvidDecoder * decoder)
for (i=0;i<decoder->SurfacesNeeded;i++) { for (i=0;i<decoder->SurfacesNeeded;i++) {
for (j=0;j<2;j++) { for (j=0;j<2;j++) {
if (decoder->cu_res[i][j]) {
checkCudaErrors(cuGraphicsUnregisterResource(decoder->cu_res[i][j])); checkCudaErrors(cuGraphicsUnregisterResource(decoder->cu_res[i][j]));
decoder->cu_res[i][j] = 0;
}
} }
} }
@ -3062,6 +3065,7 @@ static void CuvidDisplayFrame(void)
// printf("Time used %2.2f\n",CuvidDecoders[0]->Frameproc); // printf("Time used %2.2f\n",CuvidDecoders[0]->Frameproc);
glXWaitVideoSyncSGI (2, (Count + 1) % 2, &Count); // wait for previous frame to swap glXWaitVideoSyncSGI (2, (Count + 1) % 2, &Count); // wait for previous frame to swap
last_time = GetusTicks(); last_time = GetusTicks();
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
// //
// Render videos into output // Render videos into output
@ -3895,6 +3899,7 @@ void VideoGetOsdSize(int *width, int *height)
/// ///
void VideoSetOsdSize(int width, int height) void VideoSetOsdSize(int width, int height)
{ {
if (OsdConfigWidth != width || OsdConfigHeight != height) { if (OsdConfigWidth != width || OsdConfigHeight != height) {
VideoOsdExit(); VideoOsdExit();
OsdConfigWidth = width; OsdConfigWidth = width;