]> git.sesse.net Git - nageru/blobdiff - decklink_output.cpp
Do not try to adjust the audio timer during HDMI/SDI output preroll.
[nageru] / decklink_output.cpp
index b3c4c85457dedef75fd1a115fa9b82689ac27599..a826dfe22ee95c5588f86edebec1c2ad1ce64ed3 100644 (file)
@@ -242,7 +242,7 @@ void DeckLinkOutput::send_audio(int64_t pts, const std::vector<float> &samples)
        }
 }
 
-void DeckLinkOutput::wait_for_frame(int64_t pts, int *dropped_frames, int64_t *frame_duration)
+void DeckLinkOutput::wait_for_frame(int64_t pts, int *dropped_frames, int64_t *frame_duration, bool *is_preroll)
 {
        assert(!should_quit);
 
@@ -255,9 +255,12 @@ void DeckLinkOutput::wait_for_frame(int64_t pts, int *dropped_frames, int64_t *f
 
        // While prerolling, we send out frames as quickly as we can.
        if (target_time < base_pts) {
+               *is_preroll = true;
                return;
        }
 
+       *is_preroll = !playback_started;
+
        if (!playback_started) {
                if (output->EndAudioPreroll() != S_OK) {
                        fprintf(stderr, "Could not end audio preroll\n");