diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp index 21f5f8c..801625e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2296,6 +2296,16 @@ int main(int argc, char **argv) { const double this_audio_frame_time = clock_get_monotonic_seconds() - paused_time_offset; + if(paused) { + if(got_audio_data) + received_audio_time = this_audio_frame_time; + + if(!audio_device.sound_device.handle) + usleep(timeout_ms * 1000); + + continue; + } + int ret = av_frame_make_writable(audio_device.frame); if (ret < 0) { fprintf(stderr, "Failed to make audio frame writable\n"); @@ -2313,13 +2323,6 @@ int main(int argc, char **argv) { if(got_audio_data) received_audio_time = this_audio_frame_time; - if(paused) { - received_audio_time = this_audio_frame_time; - if(!audio_device.sound_device.handle) - usleep(timeout_ms * 1000); - continue; - } - // Jesus is there a better way to do this? I JUST WANT TO KEEP VIDEO AND AUDIO SYNCED HOLY FUCK I WANT TO KILL MYSELF NOW. // THIS PIECE OF SHIT WANTS EMPTY FRAMES OTHERWISE VIDEO PLAYS TOO FAST TO KEEP UP WITH AUDIO OR THE AUDIO PLAYS TOO EARLY. // BUT WE CANT USE DELAYS TO GIVE DUMMY DATA BECAUSE PULSEAUDIO MIGHT GIVE AUDIO A BIG DELAYED!!! |