From: Steinar H. Gunderson Date: Mon, 1 Jun 2020 19:37:03 +0000 (+0200) Subject: Increase the master card timeout to 200 ms. X-Git-Tag: 2.0.0~5 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=34c8970de7b295638574ceb72ae39644394e8d6d Increase the master card timeout to 200 ms. 5 fps is pretty crappy, but evidently, 100 ms happens with SRT cards all the time even when nothing is wrong. Perhaps a situation with B-frames at 30 fps? I haven't really checked. --- diff --git a/nageru/mixer.cpp b/nageru/mixer.cpp index c6f126f..cbca327 100644 --- a/nageru/mixer.cpp +++ b/nageru/mixer.cpp @@ -1471,7 +1471,7 @@ pair Mixer::get_channel_color_http(unsigned channel_idx) Mixer::OutputFrameInfo Mixer::get_one_frame_from_each_card(unsigned master_card_index, bool master_card_is_output, CaptureCard::NewFrame new_frames[MAX_VIDEO_CARDS], bool has_new_frame[MAX_VIDEO_CARDS], vector raw_audio[MAX_VIDEO_CARDS]) { OutputFrameInfo output_frame_info; - constexpr steady_clock::duration master_card_timeout = milliseconds(100); + constexpr steady_clock::duration master_card_timeout = milliseconds(200); start: unique_lock lock(card_mutex, defer_lock); bool timed_out = false; @@ -1490,13 +1490,14 @@ start: cards[master_card_index].capture->get_disconnected(); }); if (timed_out) { - fprintf(stderr, "WARNING: Master card (%s) did not deliver a frame for 100 ms, creating a fake one.\n", - description_for_card(master_card_index).c_str()); + fprintf(stderr, "WARNING: Master card (%s) did not deliver a frame for %u ms, creating a fake one.\n", + description_for_card(master_card_index).c_str(), + unsigned(duration_cast(master_card_timeout).count())); } } if (timed_out) { - // The master card stalled for 100 ms (possible when it's e.g. + // The master card stalled for 200 ms (possible when it's e.g. // an SRT card). Send a frame no matter what; this also makes sure // any other cards get to empty their queues, and in general, // that we make _some_ sort of forward progress.