Now the launch subsystem allows to call an specific function before starting a process and after it ends (this is useful to remove the single process for just renaming the movie file when adding subtitles)

Fixed a bug when the process reads from a file for stdin and/or writes to a file for stdout, and it fails

Fixed a bug in the creation of subtitles: now assigns a diferent stream id to each subtitle
This commit is contained in:
Sergio Costas 2014-08-04 20:51:03 +02:00
parent cf1220d6c3
commit 8773cebfda
4 changed files with 45 additions and 66 deletions

View file

@ -24,7 +24,6 @@ import devede.converter
import devede.ask_subtitles
import devede.preview
import devede.file_copy
import devede.rename_file
import devede.subtitles_mux
class file_movie(devede.interface_manager.interface_manager):
@ -405,7 +404,7 @@ class file_movie(devede.interface_manager.interface_manager):
self.wtreview_subtitles = self.builder.get_object("treeview_subtitles")
self.wdel_subtitles = self.builder.get_object("del_subtitles")
selection = self.wsubtitles_list.get_selection()
selection = self.wtreview_subtitles.get_selection()
selection.set_mode(Gtk.SelectionMode.BROWSE)
# elements in page VIDEO OPTIONS
@ -578,11 +577,8 @@ class file_movie(devede.interface_manager.interface_manager):
duration2 = self.original_length
else:
duration2 = duration
stream_id = 0
for subt in self.subtitles_list:
renamer = devede.rename_file.rename_file()
renamer.rename(output_path, output_path+".tmp")
renamer.add_dependency(last_process)
converter.add_child_process(renamer)
subt_file = subt[0]
subt_codepage = subt[1]
subt_lang = subt[2]
@ -592,11 +588,13 @@ class file_movie(devede.interface_manager.interface_manager):
else:
final_aspect = "4:3"
subt_mux = devede.subtitles_mux.subtitles_mux()
subt_mux.multiplex_subtitles( output_path+".tmp", output_path, subt_file, subt_codepage, subt_lang, subt_upper,
self.subt_font_size,self.format_pal,self.force_subtitles, final_aspect, duration2)
subt_mux.add_dependency(renamer)
subt_mux.multiplex_subtitles( output_path, subt_file, subt_codepage, subt_lang, subt_upper,
self.subt_font_size,self.format_pal,self.force_subtitles,
final_aspect, duration2, stream_id)
subt_mux.add_dependency(last_process)
converter.add_child_process(subt_mux)
last_process = subt_mux
stream_id += 1
return converter