Hi all, 4 of 8 ) Change gif video provider to use new monotonic pthread interface.
Regards, diff --git a/interfaces/IDirectFBVideoProvider/idirectfbvideoprovider_gif.c b/interfaces/IDirectFBVideoProvider/idirectfbvideoprovider_gif.c index 29e04e8..ea29d27 100644 --- a/interfaces/IDirectFBVideoProvider/idirectfbvideoprovider_gif.c +++ b/interfaces/IDirectFBVideoProvider/idirectfbvideoprovider_gif.c @@ -800,19 +800,16 @@ GIFVideo( DirectThread *self, void *arg ) } else { struct timespec ts; - struct timeval tv; unsigned long us; - gettimeofday( &tv, NULL ); - us = data->delayTime; if (data->speed != 1.0) us = ((double)us / data->speed + .5); - us += tv.tv_usec; - - ts.tv_sec = tv.tv_sec + us/1000000; - ts.tv_nsec = (us%1000000) * 1000; - + + direct_util_get_monotonic_pthread_timeout(&ts, + us/1000000, + (us%1000000) * 1000); + pthread_cond_timedwait( &data->cond, &data->lock, &ts ); } @@ -1057,7 +1054,7 @@ Construct( IDirectFBVideoProvider *thiz, data->buffer->GetPosition( data->buffer, &data->start_pos ); direct_util_recursive_pthread_mutex_init( &data->lock ); - pthread_cond_init( &data->cond, NULL ); + direct_util_monotonic_pthread_cond_init( &data->cond ); thiz->AddRef = IDirectFBVideoProvider_GIF_AddRef; thiz->Release = IDirectFBVideoProvider_GIF_Release; _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev