From 5b07244e1e99e99240a6ab26df35a0ad20874e45 Mon Sep 17 00:00:00 2001
From: germanocaumo <germanocaumo@gmail.com>
Date: Fri, 11 Sep 2020 20:01:41 -0300
Subject: [PATCH] Fix last commit

---
 record-and-playback/core/lib/recordandplayback/edl/audio.rb    | 2 +-
 .../core/lib/recordandplayback/generators/events.rb            | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/record-and-playback/core/lib/recordandplayback/edl/audio.rb b/record-and-playback/core/lib/recordandplayback/edl/audio.rb
index db24d0b24f..5682fef63a 100644
--- a/record-and-playback/core/lib/recordandplayback/edl/audio.rb
+++ b/record-and-playback/core/lib/recordandplayback/edl/audio.rb
@@ -25,9 +25,9 @@ module BigBlueButton
       FFMPEG_AFORMAT_SCREENSHARE = "aresample=async=1000,aformat=sample_fmts=s16:sample_rates=48000:channel_layouts=stereo"
       FFMPEG_WF_CODEC = 'libvorbis'
       FFMPEG_WF_ARGS = ['-c:a', FFMPEG_WF_CODEC, '-q:a', '2', '-f', 'ogg']
-      WF_EXT = 'ogg'
       FFMPEG_WF_SCREENSHARE_CODEC = 'libopus'
       FFMPEG_WF_SCREENSHARE_ARGS = ['-c:a', FFMPEG_WF_SCREENSHARE_CODEC, '-b:a', '48K', '-f', 'opus']
+      WF_EXT = 'ogg'
 
       def self.dump(edl)
         BigBlueButton.logger.debug "EDL Dump:"
diff --git a/record-and-playback/core/lib/recordandplayback/generators/events.rb b/record-and-playback/core/lib/recordandplayback/generators/events.rb
index 94be3e5e8b..6dd353a388 100755
--- a/record-and-playback/core/lib/recordandplayback/generators/events.rb
+++ b/record-and-playback/core/lib/recordandplayback/generators/events.rb
@@ -693,7 +693,8 @@ module BigBlueButton
     end
 
     # Check if any screenshare files has audio
-    def self.screenshare_has_audio?(events)
+    def self.screenshare_has_audio?(events_xml)
+      events = Nokogiri::XML(File.open(events_xml))
       events.xpath('/recording/event[@eventname="StartWebRTCDesktopShareEvent"]').each do |event|
         filename = event.at_xpath('filename').text
         fileHasAudio = !BigBlueButton::EDL::Audio.audio_info(filename)[:audio].nil?
-- 
GitLab