New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
|
|
@ -5,25 +5,25 @@
|
|||
#include <obs.h>
|
||||
|
||||
struct sync_pair_aud {
|
||||
bool initialized_thread;
|
||||
pthread_t thread;
|
||||
os_event_t *event;
|
||||
bool initialized_thread;
|
||||
pthread_t thread;
|
||||
os_event_t *event;
|
||||
obs_source_t *source;
|
||||
};
|
||||
|
||||
/* middle C */
|
||||
static const double rate = 261.63/48000.0;
|
||||
static const double rate = 261.63 / 48000.0;
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
||||
#define M_PI_X2 M_PI*2
|
||||
#define M_PI_X2 M_PI * 2
|
||||
|
||||
extern uint64_t starting_time;
|
||||
|
||||
static inline bool whitelist_time(uint64_t ts, uint64_t interval,
|
||||
uint64_t fps_num, uint64_t fps_den)
|
||||
uint64_t fps_num, uint64_t fps_den)
|
||||
{
|
||||
if (!starting_time)
|
||||
return false;
|
||||
|
|
@ -53,8 +53,8 @@ static void *sync_pair_aud_thread(void *pdata)
|
|||
last_time = obs_get_video_frame_time();
|
||||
|
||||
for (uint64_t i = 0; i < frames; i++) {
|
||||
uint64_t ts = last_time +
|
||||
i * 1000000000ULL / sample_rate;
|
||||
uint64_t ts =
|
||||
last_time + i * 1000000000ULL / sample_rate;
|
||||
|
||||
if (whitelist_time(ts, interval, fps_num, fps_den)) {
|
||||
cos_val += rate * M_PI_X2;
|
||||
|
|
@ -68,7 +68,7 @@ static void *sync_pair_aud_thread(void *pdata)
|
|||
}
|
||||
|
||||
struct obs_source_audio data;
|
||||
data.data[0] = (uint8_t*)samples;
|
||||
data.data[0] = (uint8_t *)samples;
|
||||
data.frames = frames;
|
||||
data.speakers = SPEAKERS_MONO;
|
||||
data.samples_per_sec = sample_rate;
|
||||
|
|
@ -106,8 +106,7 @@ static void sync_pair_aud_destroy(void *data)
|
|||
}
|
||||
}
|
||||
|
||||
static void *sync_pair_aud_create(obs_data_t *settings,
|
||||
obs_source_t *source)
|
||||
static void *sync_pair_aud_create(obs_data_t *settings, obs_source_t *source)
|
||||
{
|
||||
struct sync_pair_aud *spa = bzalloc(sizeof(struct sync_pair_aud));
|
||||
spa->source = source;
|
||||
|
|
@ -128,10 +127,10 @@ fail:
|
|||
}
|
||||
|
||||
struct obs_source_info sync_audio = {
|
||||
.id = "sync_audio",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.id = "sync_audio",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_AUDIO,
|
||||
.get_name = sync_pair_aud_getname,
|
||||
.create = sync_pair_aud_create,
|
||||
.destroy = sync_pair_aud_destroy,
|
||||
.get_name = sync_pair_aud_getname,
|
||||
.create = sync_pair_aud_create,
|
||||
.destroy = sync_pair_aud_destroy,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue