Changeset 4896:0cd0dc3bc104 in roaraudio
- Timestamp:
- 04/29/11 15:28:16 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/libroar.h
r4824 r4896 195 195 #define ROAR_MIN ROAR_MIN2 196 196 197 void roar_usleep(uint_least32_t t); 198 197 199 #endif 198 200 -
libroar/libroar.c
r4790 r4896 97 97 } 98 98 99 void roar_usleep(uint_least32_t t) { 100 #ifdef ROAR_TARGET_WIN32 101 Sleep(t/(uint_least32_t)1000); 102 #elif defined(ROAR_HAVE_NANOSLEEP) 103 struct timespec tv; 104 struct timespec left; 105 106 if ( t > (uint_least32_t)1000000 ) { 107 tv.tv_sec = t/(uint_least32_t)1000000; 108 t -= tv.tv_sec*(uint_least32_t)1000000; 109 } else { 110 tv.tv_sec = 0; 111 } 112 113 tv.tv_nsec = t*(uint_least32_t)1000; 114 115 while (nanosleep(&tv, &left) == -1) 116 memcpy(&tv, &left, sizeof(tv)); 117 #elif defined(ROAR_HAVE_USLEEP) 118 usleep(t); 119 #else 120 ROAR_ERR("roar_usleep(t=%llu): can not sleep: not implemented", (long long unsigned int)t); 121 roar_strap(ROAR_TRAP_GROUP_LIBROAR, "usleep.not-implemented"); 122 roar_err_set(ROAR_ERROR_NOSYS); 123 #endif 124 } 125 99 126 //ll -
libroarpulse/util.c
r4708 r4896 96 96 /** Wait t milliseconds */ 97 97 int pa_msleep(unsigned long t) { 98 #ifdef ROAR_TARGET_WIN32 99 Sleep(t); 100 #else 101 usleep(1000*t); 102 #endif 98 roar_usleep((uint_least32_t)1000*(uint_least32_t)t); 103 99 return 0; 104 100 } -
roard/driver_sysclock.c
r4708 r4896 113 113 114 114 if ( diff > 0 ) 115 usleep(diff);115 roar_usleep(diff); 116 116 117 117 return count; -
roard/loop.c
r4820 r4896 123 123 #ifdef ROAR_HAVE_USLEEP 124 124 if ( g_standby || (streams < 1 && g_autostandby) ) { 125 usleep((1000000 * ROAR_OUTPUT_BUFFER_SAMPLES) / sa->rate);125 roar_usleep(((uint_least32_t)1000000 * ROAR_OUTPUT_BUFFER_SAMPLES) / sa->rate); 126 126 ROAR_DBG("usleep(%u) = ?\n", (1000000 * ROAR_OUTPUT_BUFFER_SAMPLES) / sa->rate); 127 127 } else { -
roard/streams.c
r4847 r4896 2427 2427 2428 2428 #ifdef ROAR_HAVE_USLEEP 2429 usleep(100); // 0.1ms2429 roar_usleep(100); // 0.1ms 2430 2430 #endif 2431 2431
Note: See TracChangeset
for help on using the changeset viewer.