]> git.sesse.net Git - nageru/blobdiff - ffmpeg_capture.cpp
Make FFmpegCapture send semi-reasonable timestamps with its audio data.
[nageru] / ffmpeg_capture.cpp
index b8010d08219b52e30479b299822550ac8a850519..e7f25e3750a88237a66bda46c7425e7a953db2fd 100644 (file)
@@ -463,6 +463,7 @@ bool FFmpegCapture::play_video(const string &pathname)
                        }
                        next_frame_start = compute_frame_start(frame->pts, pts_origin, video_timebase, start, rate);
                        video_frame->received_timestamp = next_frame_start;
+                       audio_frame->received_timestamp = next_frame_start;
                        bool finished_wakeup = producer_thread_should_quit.sleep_until(next_frame_start);
                        if (finished_wakeup) {
                                if (audio_frame->len > 0) {