]> git.vomp.tv Git - vompclient.git/commitdiff
Fix infinite loop in OSD
authorMarten Richter <marten.richter@freenet.de>
Sun, 10 Jun 2012 14:00:33 +0000 (16:00 +0200)
committerMarten Richter <marten.richter@freenet.de>
Sun, 10 Jun 2012 14:00:33 +0000 (16:00 +0200)
osdopengl.cc
videovpeogl.cc

index d83557015e754037134908a3027e222645be73cf..1547cafdd8a2068be515b9ba7f6c6411c93fbb05 100755 (executable)
@@ -403,13 +403,11 @@ void OsdOpenGL::threadMethod()
 \r
        //glmutex.Unlock();\r
        VPEOGLFrame *frame=NULL;\r
-       struct timespec ts;\r
-       ts.tv_sec=0;\r
-       ts.tv_nsec=0;\r
+       int ts=0;\r
        VideoVPEOGL* video =(VideoVPEOGL*) Video::getInstance();\r
        while (true)\r
        {\r
-               ts.tv_nsec=10*1000000LL;\r
+               ts=10;\r
                unsigned int waittime=10;\r
                if (initted){\r
                        if (!frame) frame=video->getReadyOGLFrame();\r
@@ -427,9 +425,19 @@ void OsdOpenGL::threadMethod()
                        }\r
                        frame=video->getReadyOGLFrame();\r
                }\r
-               if (frame) ts.tv_nsec=0;\r
+\r
+               if (frame) ts=0;\r
                threadCheckExit();\r
-               if (ts.tv_nsec!=0) threadWaitForSignalTimed(&ts);\r
+               if (ts!=0) {\r
+                       struct timespec target_time;\r
+                       clock_gettime(CLOCK_REALTIME,&target_time);\r
+                       target_time.tv_nsec+=1000000LL*ts;\r
+                       if (target_time.tv_nsec>999999999) {\r
+                               target_time.tv_nsec-=1000000000L;\r
+                               target_time.tv_sec+=1;\r
+                       }\r
+                       threadWaitForSignalTimed(&target_time);\r
+               }\r
                //Sleep(1);\r
        }\r
        //eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );\r
index f5286872897f31918d59b50b4450480f476cccab..938fea838e12d53d9f2f53ce7ef347bf5b967a78 100755 (executable)
@@ -47,8 +47,9 @@ VideoVPEOGL::VideoVPEOGL()
   dec_frame_libav_uploading=NULL;
   dec_frame_libav_decoding=NULL;
   ogl_frame_outside=false;
-  //decoding_mode=VPE_NO_XVMC;
-  decoding_mode=VPE_XVMC_MOCOMP;
+  decoding_mode=VPE_NO_XVMC;
+  //decoding_mode=VPE_XVMC_MOCOMP;
+  //decoding_mode=VPE_XVMC_IDCT;
   framebuf_framenum=0;
 #endif