]> git.sesse.net Git - nageru/blobdiff - alsa_input.cpp
Fix an issue where the v210 input texture would have an inefficient width.
[nageru] / alsa_input.cpp
index ff726f06f6002de1d992e471e57667c7fd004c0b..0d6901423b17085d65459708385a5fcb055218a4 100644 (file)
@@ -5,12 +5,14 @@
 #include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <cstdint>
 
 #include "alsa_pool.h"
 #include "bmusb/bmusb.h"
 #include "timebase.h"
 
 using namespace std;
+using namespace std::chrono;
 using namespace std::placeholders;
 
 #define RETURN_ON_ERROR(msg, expr) do {                                                    \
@@ -242,10 +244,11 @@ ALSAInput::CaptureEndReason ALSAInput::do_capture()
 
                const int64_t prev_pts = frames_to_pts(num_frames_output);
                const int64_t pts = frames_to_pts(num_frames_output + frames);
+               const steady_clock::time_point now = steady_clock::now();
                bool success;
                do {
                        if (should_quit) return CaptureEndReason::REQUESTED_QUIT;
-                       success = audio_callback(buffer.get(), frames, audio_format, pts - prev_pts);
+                       success = audio_callback(buffer.get(), frames, audio_format, pts - prev_pts, now);
                } while (!success);
                num_frames_output += frames;
        }