X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fmixer.cpp;h=76354787d877e2deb9e1bb15595ec60703ee14ea;hb=a8caa042297b106e083a9087829c318e01383002;hp=9d3b12cfd90d4bbad29f1d1bae3f54b2446a5fb6;hpb=f34a3e1bbc207541842e0b54d5418d95bafc8e5b;p=nageru diff --git a/nageru/mixer.cpp b/nageru/mixer.cpp index 9d3b12c..7635478 100644 --- a/nageru/mixer.cpp +++ b/nageru/mixer.cpp @@ -618,7 +618,7 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT if (is_active) { card->capture->set_frame_callback(bind(&Mixer::bm_frame, this, card_index, _1, _2, _3, _4, _5, _6, _7)); if (card->frame_allocator == nullptr) { - card->frame_allocator.reset(new PBOFrameAllocator(pixel_format, 8 << 20, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get())); // 8 MB. + card->frame_allocator.reset(new PBOFrameAllocator(pixel_format, FRAME_SIZE, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get())); } else { // The format could have changed, but we cannot reset the allocator // and create a new one from scratch, since there may be allocated @@ -627,7 +627,7 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT // any old ones as they come back. This takes the mutex while // allocating, but nothing should really be sending frames in there // right now anyway (start_bm_capture() has not been called yet). - card->frame_allocator->reconfigure(pixel_format, 8 << 20, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get()); + card->frame_allocator->reconfigure(pixel_format, FRAME_SIZE, global_flags.width, global_flags.height, card_index, mjpeg_encoder.get()); } card->capture->set_video_frame_allocator(card->frame_allocator.get()); if (card->surface == nullptr) { @@ -981,7 +981,7 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode, // (Could be nonintegral, but resampling will save us then.) const int silence_samples = OUTPUT_FREQUENCY * video_format.frame_rate_den / video_format.frame_rate_nom; - if (dropped_frames > MAX_FPS * 2) { + if (dropped_frames > TYPICAL_FPS * 2) { fprintf(stderr, "%s lost more than two seconds (or time code jumping around; from 0x%04x to 0x%04x), resetting resampler\n", description_for_card(card_index).c_str(), card->last_timecode, timecode); audio_mixer->reset_resampler(device); @@ -2202,7 +2202,13 @@ void Mixer::start_srt() addr.sin6_family = AF_INET6; addr.sin6_port = htons(global_flags.srt_port); - int err = srt_bind(sock, (sockaddr *)&addr, sizeof(addr)); + int zero = 0; + int err = srt_setsockopt(sock, /*level=*/0, SRTO_IPV6ONLY, &zero, sizeof(zero)); + if (err != 0) { + fprintf(stderr, "srt_setsockopt(SRTO_IPV6ONLY): %s\n", srt_getlasterror_str()); + abort(); + } + err = srt_bind(sock, (sockaddr *)&addr, sizeof(addr)); if (err != 0) { fprintf(stderr, "srt_bind: %s\n", srt_getlasterror_str()); abort();