aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-04-10 22:43:02 +0200
committerdec05eba <dec05eba@protonmail.com>2024-04-10 22:43:02 +0200
commitf8322c3c2838635d4a09b36811367b4dcdd7d751 (patch)
tree8307efa799c79dadde7822285d4b651c8e2c4b5a
parent2b3070f108036a2eee50b4a7b8cbfc3eb60cf748 (diff)
Remove audio sync delay fix, it doesn't work for everybody
-rw-r--r--src/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2365f56..faab93b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -241,7 +241,9 @@ static AVSampleFormat audio_codec_get_sample_format(AudioCodec audio_codec, cons
supports_s16 = false;
if(!supports_s16 && !supports_flt) {
- fprintf(stderr, "Warning: opus audio codec is chosen but your ffmpeg version does not support s16/flt sample format and performance might be slightly worse. You can either rebuild ffmpeg with libopus instead of the built-in opus, use the flatpak version of gpu screen recorder or record with flac audio codec instead (-ac flac). Falling back to fltp audio sample format instead.\n");
+ fprintf(stderr, "Warning: opus audio codec is chosen but your ffmpeg version does not support s16/flt sample format and performance might be slightly worse.\n");
+ fprintf(stderr, " You can either rebuild ffmpeg with libopus instead of the built-in opus, use the flatpak version of gpu screen recorder or record with aac audio codec instead (-ac aac).\n");
+ fprintf(stderr, " Falling back to fltp audio sample format instead.\n");
}
if(supports_s16)
@@ -2399,6 +2401,8 @@ int main(int argc, char **argv) {
double received_audio_time = clock_get_monotonic_seconds();
const int64_t timeout_ms = std::round((1000.0 / (double)audio_track.codec_context->sample_rate) * 1000.0);
+ // Remove this for now, it doesn't work well for everybody. The timing is different depending on system
+ #if 0
// Move audio forward by around 252 ms (for opus/aac), or 42ms for flac. This is just a shitty way to handle audio latency but pulseaudio latency calculation
// returns much lower value which isn't helpful.
if(needs_audio_conversion)
@@ -2428,6 +2432,7 @@ int main(int argc, char **argv) {
}
audio_device.frame->pts += audio_track.codec_context->frame_size;
}
+ #endif
while(running) {
void *sound_buffer;