[Git][noosfero/noosfero][master] 2 commits: HTML5VideoPlugin: Bug fixes on video processor

Rodrigo Souto gitlab at mg.gitlab.com
Fri Oct 6 10:50:23 BRT 2017


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
1af29dda by Gabriel Silva at 2017-10-05T15:01:36+00:00
HTML5VideoPlugin: Bug fixes on video processor

- Service gracefully kills all children processes
- Conversor handles videos without audio streams
- Writes pidfiles in tmp folder

Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>

- - - - -
5584f35b by Rodrigo Souto at 2017-10-06T13:40:52+00:00
Merge branch 'script_improvs' into 'master'

HTML5VideoPlugin: Bug fixes on video processor

See merge request noosfero/noosfero!1325
- - - - -


5 changed files:

- plugins/html5_video/lib/video_processor/ffmpeg.rb
- + plugins/html5_video/script/init/video_processor
- plugins/html5_video/script/video_processor
- plugins/html5_video/script/video_processor_foreground.rb
- script/noosfero-plugins


Changes:

=====================================
plugins/html5_video/lib/video_processor/ffmpeg.rb
=====================================
--- a/plugins/html5_video/lib/video_processor/ffmpeg.rb
+++ b/plugins/html5_video/lib/video_processor/ffmpeg.rb
@@ -140,6 +140,7 @@ class VideoProcessor::Ffmpeg
   end
 
   def valid_abrate_for_web(info)
+    return 0 if info.audio_stream.empty?
     if brate = info.audio_stream[0][:bitrate]
       brate = 8 if brate < 8
       (brate>128)? 128 : brate


=====================================
plugins/html5_video/script/init/video_processor
=====================================
--- /dev/null
+++ b/plugins/html5_video/script/init/video_processor
@@ -0,0 +1 @@
+../video_processor
\ No newline at end of file


=====================================
plugins/html5_video/script/video_processor
=====================================
--- a/plugins/html5_video/script/video_processor
+++ b/plugins/html5_video/script/video_processor
@@ -3,4 +3,6 @@
 require 'daemons'
 
 script = File.join(__dir__, 'video_processor_foreground.rb')
-Daemons.run(script, app_name: 'video_processor')
+tmp_folder = File.join(__dir__, '../../../tmp/')
+Daemons.run(script, app_name: 'video_processor', dir_mode: :normal,
+                    dir: tmp_folder)


=====================================
plugins/html5_video/script/video_processor_foreground.rb
=====================================
--- a/plugins/html5_video/script/video_processor_foreground.rb
+++ b/plugins/html5_video/script/video_processor_foreground.rb
@@ -100,6 +100,12 @@ unless RAILS_ENV == 'test'
     env_ids.each{|env_id| process_all_files(env_id, pool.to_sym) }
   end
 
+  trap "SIGTERM" do
+    # Gracefully finish all child processes
+    Process.kill("TERM", 0)
+    Process.exit
+  end
+
   # Start watching the pool dir
   watch_pool
 end


=====================================
script/noosfero-plugins
=====================================
--- a/script/noosfero-plugins
+++ b/script/noosfero-plugins
@@ -269,7 +269,7 @@ shift
 
 
 case "$command" in
-  enableall|disableall|enable|disable|new|services)
+  enableall|disableall|enable|disable|new)
     if [ ! -w "$enabled_plugins_dir" ]; then
       echo "E: sorry, you don't have the required permissions to manage plugins"
       exit 2



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/960052a652905a15a7026454940229c1432550dd...5584f35be675a48ec1ad832d984a0ff04dcf4896

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/960052a652905a15a7026454940229c1432550dd...5584f35be675a48ec1ad832d984a0ff04dcf4896
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20171006/344c124e/attachment-0001.html>


More information about the Noosfero-dev mailing list