|
@@ -22,10 +22,13 @@
|
|
|
#include "../util/darray.h"
|
|
|
#include "../util/circlebuf.h"
|
|
|
#include "../util/platform.h"
|
|
|
+#include "../util/profiler.h"
|
|
|
|
|
|
#include "audio-io.h"
|
|
|
#include "audio-resampler.h"
|
|
|
|
|
|
+extern profiler_name_store_t *obs_get_profiler_name_store(void);
|
|
|
+
|
|
|
/* #define DEBUG_AUDIO */
|
|
|
|
|
|
#define nop() do {int invalid = 0;} while(0)
|
|
@@ -402,9 +405,14 @@ static void *audio_thread(void *param)
|
|
|
|
|
|
os_set_thread_name("audio-io: audio thread");
|
|
|
|
|
|
+ const char *audio_thread_name =
|
|
|
+ profile_store_name(obs_get_profiler_name_store(),
|
|
|
+ "audio_thread(%s)", audio->info.name);
|
|
|
+
|
|
|
while (os_event_try(audio->stop_event) == EAGAIN) {
|
|
|
os_sleep_ms(AUDIO_WAIT_TIME);
|
|
|
|
|
|
+ profile_start(audio_thread_name);
|
|
|
pthread_mutex_lock(&audio->line_mutex);
|
|
|
|
|
|
audio_time = os_gettime_ns() - buffer_time;
|
|
@@ -412,6 +420,9 @@ static void *audio_thread(void *param)
|
|
|
prev_time = audio_time;
|
|
|
|
|
|
pthread_mutex_unlock(&audio->line_mutex);
|
|
|
+ profile_end(audio_thread_name);
|
|
|
+
|
|
|
+ profile_reenable_thread();
|
|
|
}
|
|
|
|
|
|
return NULL;
|