From e30d28cfb9a4ca32821be1b6bdeb37dfbb38ecba Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 17 Nov 2015 19:37:37 +0100 Subject: [PATCH] If we reset the resampling queue, do not try to add audio from the section we skipped over; things will go horribly out of sync. --- mixer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mixer.cpp b/mixer.cpp index 1603b8d..be28478 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -263,6 +263,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode, 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); card->resampling_queue.reset(new ResamplingQueue(OUTPUT_FREQUENCY, OUTPUT_FREQUENCY, 2)); + 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", -- 2.39.2