mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-07 15:19:55 +09:00
Remove audio compenstation
This commit is contained in:
@@ -2417,7 +2417,7 @@ int main(int argc, char **argv) {
|
|||||||
while(running) {
|
while(running) {
|
||||||
void *sound_buffer;
|
void *sound_buffer;
|
||||||
int sound_buffer_size = -1;
|
int sound_buffer_size = -1;
|
||||||
const double time_before_read_seconds = clock_get_monotonic_seconds();
|
//const double time_before_read_seconds = clock_get_monotonic_seconds();
|
||||||
if(audio_device.sound_device.handle) {
|
if(audio_device.sound_device.handle) {
|
||||||
// TODO: use this instead of calculating time to read. But this can fluctuate and we dont want to go back in time
|
// TODO: use this instead of calculating time to read. But this can fluctuate and we dont want to go back in time
|
||||||
double latency_seconds = 0.0;
|
double latency_seconds = 0.0;
|
||||||
@@ -2425,9 +2425,9 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bool got_audio_data = sound_buffer_size >= 0;
|
const bool got_audio_data = sound_buffer_size >= 0;
|
||||||
const double time_after_read_seconds = clock_get_monotonic_seconds();
|
//const double time_after_read_seconds = clock_get_monotonic_seconds();
|
||||||
const double time_to_read_seconds = time_after_read_seconds - time_before_read_seconds;
|
//const double time_to_read_seconds = time_after_read_seconds - time_before_read_seconds;
|
||||||
const double this_audio_frame_time = time_after_read_seconds - paused_time_offset - time_to_read_seconds;
|
const double this_audio_frame_time = clock_get_monotonic_seconds() - paused_time_offset;
|
||||||
|
|
||||||
if(paused) {
|
if(paused) {
|
||||||
if(got_audio_data)
|
if(got_audio_data)
|
||||||
|
|||||||
@@ -199,11 +199,13 @@ static int pa_sound_device_read(pa_handle *p, double timeout_seconds) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pa_operation_unref(pa_stream_update_timing_info(p->stream, NULL, NULL));
|
||||||
|
// TODO: Deal with one pa_stream_peek not being enough. In that case we need to add multiple of these together(?)
|
||||||
if(pa_stream_get_latency(p->stream, &latency, &negative) >= 0) {
|
if(pa_stream_get_latency(p->stream, &latency, &negative) >= 0) {
|
||||||
p->latency_seconds = negative ? -(int64_t)latency : latency;
|
p->latency_seconds = negative ? -(double)latency : latency;
|
||||||
p->latency_seconds *= 0.0000001;
|
|
||||||
if(p->latency_seconds < 0.0)
|
if(p->latency_seconds < 0.0)
|
||||||
p->latency_seconds = 0.0;
|
p->latency_seconds = 0.0;
|
||||||
|
p->latency_seconds *= 0.0000001;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user