From 5f748c627508bd534f2b2d17da42c7bb0c6956ee Mon Sep 17 00:00:00 2001 From: jojo61 Date: Sat, 13 Oct 2018 15:18:23 +0200 Subject: [PATCH] fixed crash at stop --- video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/video.c b/video.c index 0dddaa6..e00f906 100644 --- a/video.c +++ b/video.c @@ -3068,8 +3068,9 @@ static void CuvidDisplayFrame(void) CuvidDecoder *decoder; - glXMakeCurrent(XlibDisplay, VideoWindow, GlxContext); - CuvidDecoders[0]->Frameproc = (float)(GetusTicks()-last_time)/1000000.0; + glXMakeCurrent(XlibDisplay, VideoWindow, GlxContext); + if (CuvidDecoderN) + CuvidDecoders[0]->Frameproc = (float)(GetusTicks()-last_time)/1000000.0; // printf("Time used %2.2f\n",CuvidDecoders[0]->Frameproc); glXWaitVideoSyncSGI (2, (Count + 1) % 2, &Count); // wait for previous frame to swap last_time = GetusTicks();