Fixed the audio duration in the menu.

If a custom audio is used in the DVD menu, it will last the duration of the custom audio, not only 30 seconds.
This commit is contained in:
Sergio Costas 2018-04-29 16:09:54 +02:00
parent 810495c0d7
commit 8a68f263c3
3 changed files with 10 additions and 10 deletions

View file

@ -97,18 +97,15 @@ class dvd_menu(devedeng.interface_manager.interface_manager):
self.store_ui(self.builder)
cv = devedeng.converter.converter.get_converter()
film_analizer = (cv.get_film_analizer())()
(video, audio, length) = film_analizer.analize_film_data(
self.background_music, True)
if (video != 0):
devedeng.message.message_window(
_("The selected file is a video, not an audio file"), _("Error"))
film_analizer.get_film_data(self.background_music)
if (film_analizer.video_streams != 0):
devedeng.message.message_window(_("The selected file is a video, not an audio file"), _("Error"))
self.on_no_sound_clicked(None)
elif (audio == 0):
devedeng.message.message_window(
_("The selected file is not an audio file"), _("Error"))
elif (film_analizer.audio_streams == 0):
devedeng.message.message_window(_("The selected file is not an audio file"), _("Error"))
self.on_no_sound_clicked(None)
else:
self.sound_length = length
self.sound_length = film_analizer.original_length
def update_preview(self, b=None):