Hi all,

8 of 8 ) Change data buffer stream to use new monotonic pthread interface.

Regards,

diff --git a/src/media/idirectfbdatabuffer_streamed.c 
b/src/media/idirectfbdatabuffer_streamed.c
index 3c896ac..8294e6a 100644
--- a/src/media/idirectfbdatabuffer_streamed.c
+++ b/src/media/idirectfbdatabuffer_streamed.c
@@ -208,7 +208,6 @@ IDirectFBDataBuffer_Streamed_WaitForDataWithTimeout( 
IDirectFBDataBuffer *thiz,
                                                      unsigned 
int         seconds,
                                                      unsigned 
int         milli_seconds )
 {
-     struct timeval  now;
      struct timespec timeout;
      DFBResult       ret          = DFB_OK;
      bool            locked       = false;
@@ -229,13 +228,7 @@ 
IDirectFBDataBuffer_Streamed_WaitForDataWithTimeout( IDirectFBDataBuffer 
*thiz,
           locked = true;
      }

-     gettimeofday( &now, NULL );
-
-     timeout.tv_sec  = now.tv_sec + seconds;
-     timeout.tv_nsec = (now.tv_usec * 1000) + nano_seconds;
-
-     timeout.tv_sec  += timeout.tv_nsec / 1000000000;
-     timeout.tv_nsec %= 1000000000;
+     direct_util_get_monotonic_pthread_timeout(&timeout, seconds, 
nano_seconds);

      if (!locked)
           pthread_mutex_lock( &data->chunks_mutex );
@@ -391,7 +384,7 @@ IDirectFBDataBuffer_Streamed_Construct( 
IDirectFBDataBuffer *thiz,
           return ret;

      direct_util_recursive_pthread_mutex_init( &data->chunks_mutex );
-     pthread_cond_init( &data->wait_condition, NULL );
+     direct_util_monotonic_pthread_cond_init( &data->wait_condition );

      thiz->Release                = IDirectFBDataBuffer_Streamed_Release;
      thiz->Flush                  = IDirectFBDataBuffer_Streamed_Flush;




_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to