From 96d9f71030afdca31dafc65bf531e943d8895fa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Fri, 10 Nov 2023 15:09:45 -0300 Subject: [PATCH] v27 changes ported to v30 part 2. --- .../core/running/MeetingActor.scala | 1 + bbb-presentation-video.placeholder.sh | 2 +- .../audio/captions/speech/service.js | 11 +++------- .../core/lib/recordandplayback/edl/audio.rb | 21 ++++++++++++------- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala index b74cc4608d..13df3be32b 100755 --- a/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala +++ b/akka-bbb-apps/src/main/scala/org/bigbluebutton/core/running/MeetingActor.scala @@ -872,6 +872,7 @@ class MeetingActor( val hasModeratorLeftRecently = (TimeUtil.timeNowInMs() - state.expiryTracker.endWhenNoModeratorDelayInMs) < state.expiryTracker.lastModeratorLeftOnInMs if (!hasModeratorLeftRecently) { log.info("Meeting will end due option endWhenNoModerator is enabled and all moderators have left the meeting. meetingId=" + props.meetingProp.intId) + endAllBreakoutRooms(eventBus, liveMeeting, state, MeetingEndReason.ENDED_DUE_TO_NO_MODERATOR) sendEndMeetingDueToExpiry( MeetingEndReason.ENDED_DUE_TO_NO_MODERATOR, eventBus, outGW, liveMeeting, diff --git a/bbb-presentation-video.placeholder.sh b/bbb-presentation-video.placeholder.sh index 4d5d35056f..8285524966 100755 --- a/bbb-presentation-video.placeholder.sh +++ b/bbb-presentation-video.placeholder.sh @@ -1,6 +1,6 @@ #!/bin/sh set -ex -RELEASE=4.0.3 +RELEASE=4.0.4 cat < { makeCall('updateTranscript', id, start, end, text, transcript, locale, isFinal); }; -const throttledTranscriptUpdate = throttle(updateTranscript, THROTTLE_TIMEOUT, { - leading: false, - trailing: true, -}); +const throttledTranscriptUpdate = throttle({ interval: THROTTLE_TIMEOUT }, updateTranscript); const updateInterimTranscript = (id, transcript, locale) => { throttledTranscriptUpdate(id, transcript, locale, false); }; const updateFinalTranscript = (id, transcript, locale) => { - throttledTranscriptUpdate.cancel(); updateTranscript(id, transcript, locale, true); }; diff --git a/record-and-playback/core/lib/recordandplayback/edl/audio.rb b/record-and-playback/core/lib/recordandplayback/edl/audio.rb index c6e9912473..2764e67bbf 100644 --- a/record-and-playback/core/lib/recordandplayback/edl/audio.rb +++ b/record-and-playback/core/lib/recordandplayback/edl/audio.rb @@ -120,13 +120,20 @@ module BigBlueButton # Check for and handle audio files with mismatched lengths (generated # by buggy versions of freeswitch in old BigBlueButton - if entry[:original_duration] && (audioinfo[audio[:filename]][:duration].to_f / entry[:original_duration]) < 0.997 && - ((entry[:original_duration] - audioinfo[audio[:filename]][:duration]).to_f / - entry[:original_duration]).abs < 0.05 - BigBlueButton.logger.warn " Audio file length mismatch, adjusting speed to #{speed}" - speed = audioinfo[audio[:filename]][:duration].to_f / entry[:original_duration] - seek = 0 - end + if (audioinfo[audio[:filename]][:format][:format_name] == 'wav' || + audioinfo[audio[:filename]][:audio][:codec_name] == 'vorbis') && + entry[:original_duration] && + (audioinfo[audio[:filename]][:duration].to_f / entry[:original_duration]) < 0.997 && + ((entry[:original_duration] - audioinfo[audio[:filename]][:duration]).to_f / + entry[:original_duration]).abs < 0.05 + BigBlueButton.logger.warn " Audio file length mismatch, adjusting speed to #{speed}" + @@ -141,9 +144,9 @@ def self.render(edl, output_basename) + ffmpeg_filter << "#{FFMPEG_AEVALSRC},#{FFMPEG_AFORMAT}" + end + + ffmpeg_filter << ',asetpts=N' + + ffmpeg_filter << ",atempo=#{speed},atrim=start=#{ms_to_s(audio[:timestamp])}" if speed != 1 # Skip this input and generate silence if the seekpoint is past the end of the audio, which can happen # if events are slightly misaligned and you get unlucky with a start/stop or chapter break.