gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash/server/parser movie_def_impl.cpp


From: Vitaly Alexeev
Subject: [Gnash-commit] gnash/server/parser movie_def_impl.cpp
Date: Mon, 20 Nov 2006 15:07:39 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Vitaly Alexeev <alexeev>        06/11/20 15:07:39

Modified files:
        server/parser  : movie_def_impl.cpp 

Log message:
                * server\parser\movie_def_impl.cpp: usleep(x) ==> Sleep(x/1000) 
for win32,
                'return _thread == 0' is invalid in win32 that 'pthread_t' is 
typedef struct {
            void * p;                   /* Pointer to actual object */
            unsigned int x;             /* Extra information - reuse count etc 
*/
                } ptw32_handle_t;
                * server\video_stream_instance.h: typo
                * gui\gui.cpp: typo
                * backend\render_handler_ogl.cpp: GL/glx.h is absent in win32
                * backend\sound_handler_sdl.cpp: sdl_audio_callback() is 
switched off for win32
                because of segmentation fault
                * server\video_stream_instance.cpp: typo
                * reconfigured win32 dir

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.42&r2=1.43

Patches:
Index: movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- movie_def_impl.cpp  20 Nov 2006 12:08:05 -0000      1.42
+++ movie_def_impl.cpp  20 Nov 2006 15:07:39 -0000      1.43
@@ -57,19 +57,30 @@
 // Debug threads locking
 #undef DEBUG_THREADS_LOCKING 
 
+#if defined(_WIN32) || defined(WIN32)
+#      include <windows.h>
+# define usleep(x) Sleep(x/1000)
+#endif
+
 namespace gnash
 {
 
 MovieLoader::MovieLoader(movie_def_impl& md)
        :
        _waiting_for_frame(0),
-       _movie_def(md),
-       _thread(0)
+       _movie_def(md)
+#ifndef WIN32
+       ,_thread(0)
+#endif
 {
 #ifdef LOAD_MOVIES_IN_A_SEPARATE_THREAD
        pthread_cond_init(&_frame_reached_condition, NULL);
        pthread_mutex_init(&_mutex, NULL);
 #endif
+
+#ifdef WIN32
+       _thread.p = 0;
+#endif
 }
 
 MovieLoader::~MovieLoader()
@@ -90,13 +101,21 @@
 bool
 MovieLoader::started() const
 {
+#ifdef WIN32
+       return _thread.p != NULL;
+#else
        return _thread != 0;
+#endif
 }
 
 bool
 MovieLoader::isSelfThread() const
 {
+#ifdef WIN32
+       return _thread.p == pthread_self().p;
+#else
        return pthread_self() == _thread;
+#endif
 }
 
 void*




reply via email to

[Prev in Thread] Current Thread [Next in Thread]