]> code.delx.au - pulseaudio/blobdiff - src/modules/module-sine-source.c
Remove unnecessary #includes
[pulseaudio] / src / modules / module-sine-source.c
index 8df4d9bbc4c5bb8dc9c0822bbf2b044bf3d89b91..20a686805291d52919a63b03de7b6a7a5fa9ce32 100644 (file)
 #endif
 
 #include <stdlib.h>
-#include <sys/stat.h>
 #include <stdio.h>
 #include <errno.h>
-#include <string.h>
-#include <fcntl.h>
 #include <unistd.h>
-#include <limits.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
 
-#include <pulse/xmalloc.h>
+#include <pulse/rtclock.h>
 #include <pulse/timeval.h>
+#include <pulse/xmalloc.h>
 
-#include <pulsecore/core-error.h>
 #include <pulsecore/source.h>
 #include <pulsecore/module.h>
 #include <pulsecore/core-util.h>
@@ -46,7 +40,6 @@
 #include <pulsecore/thread.h>
 #include <pulsecore/thread-mq.h>
 #include <pulsecore/rtpoll.h>
-#include <pulsecore/rtclock.h>
 
 #include "module-sine-source-symdef.h"
 
@@ -101,14 +94,14 @@ static int source_process_msg(
         case PA_SOURCE_MESSAGE_SET_STATE:
 
             if (PA_PTR_TO_UINT(data) == PA_SOURCE_RUNNING)
-                u->timestamp = pa_rtclock_usec();
+                u->timestamp = pa_rtclock_now();
 
             break;
 
         case PA_SOURCE_MESSAGE_GET_LATENCY: {
             pa_usec_t now, left_to_fill;
 
-            now = pa_rtclock_usec();
+            now = pa_rtclock_now();
             left_to_fill = u->timestamp > now ? u->timestamp - now : 0ULL;
 
             *((pa_usec_t*) data) = u->block_usec > left_to_fill ? u->block_usec - left_to_fill : 0ULL;
@@ -167,7 +160,7 @@ static void thread_func(void *userdata) {
 
     pa_thread_mq_install(&u->thread_mq);
 
-    u->timestamp = pa_rtclock_usec();
+    u->timestamp = pa_rtclock_now();
 
     for (;;) {
         int ret;
@@ -175,7 +168,7 @@ static void thread_func(void *userdata) {
         if (PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
             pa_usec_t now;
 
-            now = pa_rtclock_usec();
+            now = pa_rtclock_now();
 
             if (u->timestamp <= now)
                 process_render(u, now);
@@ -273,7 +266,7 @@ int pa__init(pa_module*m) {
     pa_source_set_rtpoll(u->source, u->rtpoll);
     pa_source_set_fixed_latency(u->source, u->block_usec);
 
-    if (!(u->thread = pa_thread_new(thread_func, u))) {
+    if (!(u->thread = pa_thread_new("sine-source", thread_func, u))) {
         pa_log("Failed to create thread.");
         goto fail;
     }