From 35104fba47935c4cf74f2015a242ae47754d32f5 Mon Sep 17 00:00:00 2001
From: germanocaumo <germanocaumo@gmail.com>
Date: Wed, 24 Mar 2021 13:30:23 -0300
Subject: [PATCH] number of inputs for amix command, remove old java deskshare
 events

---
 .../core/lib/recordandplayback/edl/audio.rb            | 10 +++++-----
 .../core/lib/recordandplayback/generators/audio.rb     |  9 +++------
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/record-and-playback/core/lib/recordandplayback/edl/audio.rb b/record-and-playback/core/lib/recordandplayback/edl/audio.rb
index 8b3ea41f29..34dfa1c258 100644
--- a/record-and-playback/core/lib/recordandplayback/edl/audio.rb
+++ b/record-and-playback/core/lib/recordandplayback/edl/audio.rb
@@ -44,11 +44,11 @@ module BigBlueButton
       def self.mixer(inputs, output_basename)
         BigBlueButton.logger.debug "Mixing audio files"
 
-        ffmpeg_cmd = [*FFMPEG]
-        inputs.each do |input|
-          ffmpeg_cmd += ['-i', input]
-        end
-        ffmpeg_cmd += ['-filter_complex', "amix"]
+        ffmpeg_cmd = [*FFMPEG]	
+        inputs.each do |input|	
+          ffmpeg_cmd += ['-i', input]	
+        end	
+        ffmpeg_cmd += ['-filter_complex', "amix=inputs=#{inputs.length}"]
 
         output = "#{output_basename}.#{WF_EXT}"
         ffmpeg_cmd += [*FFMPEG_WF_ARGS, output]
diff --git a/record-and-playback/core/lib/recordandplayback/generators/audio.rb b/record-and-playback/core/lib/recordandplayback/generators/audio.rb
index 83bbc7ae2b..5fa99a40a4 100755
--- a/record-and-playback/core/lib/recordandplayback/generators/audio.rb
+++ b/record-and-playback/core/lib/recordandplayback/generators/audio.rb
@@ -86,13 +86,10 @@ module BigBlueButton
         :audio => nil
       }
 
-      events.xpath('/recording/event[@module="Deskshare" or (@module="bbb-webrtc-sfu" and (@eventname="StartWebRTCDesktopShareEvent" or @eventname="StopWebRTCDesktopShareEvent"))]').each do |event|
+      events.xpath('/recording/event[@module="bbb-webrtc-sfu" and (@eventname="StartWebRTCDesktopShareEvent" or @eventname="StopWebRTCDesktopShareEvent")]').each do |event|
         filename = event.at_xpath('filename').text
         # Determine the audio filename
         case event['eventname']
-        when 'DeskshareStartedEvent', 'DeskshareStoppedEvent'
-          filename = event.at_xpath('file').text
-          filename = "#{deskshare_dir}/#{File.basename(filename)}"
         when 'StartWebRTCDesktopShareEvent', 'StopWebRTCDesktopShareEvent'
           uri = event.at_xpath('filename').text
           filename = "#{deskshare_dir}/#{File.basename(uri)}"
@@ -104,12 +101,12 @@ module BigBlueButton
           timestamp = event['timestamp'].to_i - initial_timestamp
           # Add the audio to the EDL
           case event['eventname']
-          when 'DeskshareStartedEvent', 'StartWebRTCDesktopShareEvent'
+          when 'StartWebRTCDesktopShareEvent'
             audio_edl << {
               :timestamp => timestamp,
               :audio => { :filename => filename, :timestamp => 0 }
             }
-          when 'DeskshareStoppedEvent', 'StopWebRTCDesktopShareEvent'
+          when 'StopWebRTCDesktopShareEvent'
             if audio_edl.last[:audio] && audio_edl.last[:audio][:filename] == filename
               # Fill in the original/expected audo duration when available
               duration = event.at_xpath('duration')
-- 
GitLab