]> git.vomp.tv Git - vompclient.git/commitdiff
DVB Subtitles: changes for Windows port
authorMark Calderbank <mark@vomp.tv>
Fri, 5 Dec 2008 15:50:25 +0000 (15:50 +0000)
committerMark Calderbank <mark@vomp.tv>
Fri, 5 Dec 2008 15:50:25 +0000 (15:50 +0000)
dvbsubtitles.cc
surfacewin.cc
threadwin.h

index 32836d9c0356be864bc9616bbf0f1cd4d4c1e178..43c3932d18c5107927eaf6a0248aaa2650ce02e0 100644 (file)
@@ -829,10 +829,17 @@ void DVBSubtitles::hide()
 
 void DVBSubtitles::nudge()
 {
+#ifndef WIN32
   pthread_mutex_lock(&threadCondMutex);
   threadNudged = true;
   pthread_cond_signal(&threadCond);
   pthread_mutex_unlock(&threadCondMutex);
+#else
+  WaitForSingleObject(threadCondMutex, INFINITE);
+  threadNudged = true;
+  SetEvent(threadCond);
+  ReleaseMutex(threadCondMutex);
+#endif
 }
 
 void DVBSubtitles::threadMethod()
index 6b52b731ad231b0171d3b3a3b6e16c77386ced16..4139ae7dd6f1a5a72a016e37f69cfe42bae6d14e 100644 (file)
@@ -219,9 +219,11 @@ void SurfaceWin::drawVertLine(int x, int y1, int y2, unsigned int c)
 void SurfaceWin::drawBitmap(int x, int y, const Bitmap& bm)
 {
   // Temporary code? Draw one pixel at a time using drawPixel()
+  startFastDraw();
   for (UINT j = 0; j < bm.getHeight(); ++j)
     for (UINT i = 0; i < bm.getWidth(); ++i)
       drawPixel(x+i, y+j, bm.getColour(i,j));
+  endFastDraw();
 }
 
 int SurfaceWin::updateToScreen(int sx, int sy, int w, int h, int dx, int dy) // FIXME new, replace others with this FIXME
index 9a87fec65594657870b75c5515bdc612196456a0..3c4903ff4e589d0d923102a85f0aff5324ab0cc2 100644 (file)
@@ -62,7 +62,8 @@ class ThreadWin : public Thread
 
     // Internal bits and pieces
 
-  private:
+//  private: // TODO: make these private again when dvbsubtitles.cc
+             // no longer needs direct access.
     HANDLE pthread;
     HANDLE threadCondMutex;
     HANDLE threadCond;