card->capture->configure_card();
DeviceSpec device{InputSourceType::CAPTURE_CARD, card_index};
- audio_mixer.reset_device(device);
+ audio_mixer.reset_resampler(device);
audio_mixer.set_name(device, card->capture->get_description());
}
if (dropped_frames > MAX_FPS * 2) {
fprintf(stderr, "Card %d lost more than two seconds (or time code jumping around; from 0x%04x to 0x%04x), resetting resampler\n",
card_index, card->last_timecode, timecode);
- audio_mixer.reset_device(device);
+ audio_mixer.reset_resampler(device);
dropped_frames = 0;
} else if (dropped_frames > 0) {
// Insert silence as needed.
fprintf(stderr, "Card %d dropped %d frame(s) (before timecode 0x%04x), inserting silence.\n",
card_index, dropped_frames, timecode);
- audio_mixer.add_silence(device, silence_samples, dropped_frames, frame_length);
+ bool success;
+ do {
+ success = audio_mixer.add_silence(device, silence_samples, dropped_frames, frame_length);
+ } while (!success);
}
audio_mixer.add_audio(device, audio_frame.data + audio_offset, num_samples, audio_format, frame_length);
int stats_dropped_frames = 0;
while (!should_quit) {
- CaptureCard::NewFrame new_frames[MAX_CARDS];
- bool has_new_frame[MAX_CARDS] = { false };
- int num_samples[MAX_CARDS] = { 0 };
+ CaptureCard::NewFrame new_frames[MAX_VIDEO_CARDS];
+ bool has_new_frame[MAX_VIDEO_CARDS] = { false };
+ int num_samples[MAX_VIDEO_CARDS] = { 0 };
unsigned master_card_index = theme->map_signal(master_clock_channel);
assert(master_card_index < num_cards);
resource_pool->clean_context();
}
-void Mixer::get_one_frame_from_each_card(unsigned master_card_index, CaptureCard::NewFrame new_frames[MAX_CARDS], bool has_new_frame[MAX_CARDS], int num_samples[MAX_CARDS])
+void Mixer::get_one_frame_from_each_card(unsigned master_card_index, CaptureCard::NewFrame new_frames[MAX_VIDEO_CARDS], bool has_new_frame[MAX_VIDEO_CARDS], int num_samples[MAX_VIDEO_CARDS])
{
start:
// The first card is the master timer, so wait for it to have a new frame.