From 7299168b15abbe5565a0629bc7bf9b927ba2f9bb Mon Sep 17 00:00:00 2001 From: Sergio Costas Date: Sat, 7 Nov 2015 19:40:23 +0100 Subject: [PATCH] Added extra debug code to try to discover why, sometimes, it assign incorrect stream ids --- HISTORY.md | 6 ++++++ setup.py | 2 +- src/devedeng/avprobe.py | 4 ++-- src/devedeng/configuration_data.py | 13 ++++++++++++- src/devedeng/ffprobe.py | 5 ++--- src/devedeng/mplayer.py | 14 ++++++++++++-- 6 files changed, 35 insertions(+), 9 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 9509b35..f7e06b7 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,11 @@ ## History of versions ## +* version 4.3.2 (2015-11-07) + * Added extra debug info in the log + +* version 4.3.1 (2015-11-07) + * Added manpage (thanks to Alession Treglia) + * version 4.3 (2015-10-26) * Now doesn't fail when creating a DVD without menu * Added help in html format diff --git a/setup.py b/setup.py index 06eac9d..31a01e1 100755 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ compile_translations() setup( name='devedeng', - version='4.3', + version='4.3.2', description='A video DVD creator', long_description = "A program that allows to create video DVDs", diff --git a/src/devedeng/avprobe.py b/src/devedeng/avprobe.py index ed1d05f..880fa88 100644 --- a/src/devedeng/avprobe.py +++ b/src/devedeng/avprobe.py @@ -70,7 +70,7 @@ class avprobe(devedeng.avbase.avbase): stdout2 = stdout.decode("utf-8") except: stdout2 = stdout.decode("latin1") - self.config.append_log("AVProbe JSON data: "+str(stdout2)) + self.config.append_static_log("AVProbe JSON data: "+str(stdout2)) return self.process_json(stdout2, file_name) @@ -143,7 +143,7 @@ class avprobe(devedeng.avbase.avbase): stdout2 = stdout.decode("utf-8") + "\n" + stderr.decode("utf-8") except: stdout2 = stdout.decode("latin1") + "\n" + stderr.decode("latin1") - self.config.append_log("Using avprobe human readable format: "+str(stdout2)) + self.config.append_static_log("Using avprobe human readable format: "+str(stdout2)) for line in stdout2.split("\n"): line = line.strip() if line.startswith("Duration: "): diff --git a/src/devedeng/configuration_data.py b/src/devedeng/configuration_data.py index 98b65f8..9a0090a 100644 --- a/src/devedeng/configuration_data.py +++ b/src/devedeng/configuration_data.py @@ -50,6 +50,7 @@ class configuration(GObject.GObject): is_local = None self.log = "" + self.static_log = "" self.disc_type = None try: @@ -174,6 +175,8 @@ class configuration(GObject.GObject): def set_disc_type(self,disc_type): self.disc_type = disc_type + self.clear_static_log() + self.clear_log() self.emit('disc_type',disc_type) @@ -228,12 +231,20 @@ class configuration(GObject.GObject): if (cr): self.log += "\n" + def append_static_log(self,data,cr = True): + + self.static_log += data + if (cr): + self.static_log += "\n" def clear_log(self): self.log = "" + def clear_static_log(self): + + self.static_log = "" def get_log(self): - return self.log + return self.static_log + "\n" + self.log diff --git a/src/devedeng/ffprobe.py b/src/devedeng/ffprobe.py index 1dd4c17..3fc11af 100644 --- a/src/devedeng/ffprobe.py +++ b/src/devedeng/ffprobe.py @@ -69,8 +69,7 @@ class ffprobe(devedeng.executor.executor): stdout2 = stdout.decode("utf-8") except: stdout2 = stdout.decode("latin1") - - self.config.append_log("FFProbe JSON data: "+str(stdout2)) + self.config.append_static_log("FFProbe JSON data: "+str(stdout2)) return self.process_json(file_name,stdout2) @@ -143,7 +142,7 @@ class ffprobe(devedeng.executor.executor): stdout2 = stdout.decode("utf-8") + "\n" + stderr.decode("utf-8") except: stdout2 = stdout.decode("latin1") + "\n" + stderr.decode("latin1") - self.config.append_log("Using ffprobe human readable format: "+str(stdout2)) + self.config.append_static_log("Using ffprobe human readable format: "+str(stdout2)) for line in stdout2.split("\n"): line = line.strip() if line.startswith("Duration: "): diff --git a/src/devedeng/mplayer.py b/src/devedeng/mplayer.py index 40f71ba..5b31fbb 100644 --- a/src/devedeng/mplayer.py +++ b/src/devedeng/mplayer.py @@ -123,20 +123,28 @@ class mplayer(devedeng.executor.executor): if command=="ID_VIDEO_BITRATE": self.original_videorate=int(int(parameter)/1000) + self.config.append_static_log("ID_VIDEO_BITRATE: "+str(self.original_videorate)) if command=="ID_VIDEO_WIDTH": self.original_width=int(parameter) + self.config.append_static_log("ID_VIDEO_WIDTH: "+str(self.original_width)) if command=="ID_VIDEO_HEIGHT": self.original_height=int(parameter) + self.config.append_static_log("ID_VIDEO_HEIGHT: "+str(self.original_height)) if command=="ID_VIDEO_ASPECT": self.original_aspect_ratio=float(parameter) + self.config.append_static_log("ID_VIDEO_ASPECT: "+str(self.original_aspect_ratio)) if command=="ID_VIDEO_FPS": self.original_fps=float(parameter) + self.config.append_static_log("ID_VIDEO_FPS: "+str(self.original_fps)) if command=="ID_AUDIO_BITRATE": self.original_audiorate=int(int(parameter)/1000) + self.config.append_static_log("ID_AUDIO_BITRATE: "+str(self.original_audiorate)) if command=="ID_AUDIO_RATE": self.original_audiorate_uncompressed=int(parameter) + self.config.append_static_log("ID_AUDIO_RATE: "+str(self.original_audiorate_uncompressed)) if command=="ID_LENGTH": self.original_length=int(float(parameter)) + self.config.append_static_log("ID_LENGTH: "+str(self.original_length)) if command=="ID_VIDEO_ID": self.video_streams+=1 @@ -144,16 +152,18 @@ class mplayer(devedeng.executor.executor): if (minimum_video == -1) or (minimum_video>video_track): minimum_video=video_track self.video_list.append(stream_number) + self.config.append_static_log("ID_VIDEO_ID: "+str(stream_number)) if command=="ID_AUDIO_ID": self.audio_streams+=1 audio_track=int(parameter) if (minimum_audio == -1) or (minimum_audio>audio_track): minimum_audio=audio_track self.audio_list.append(stream_number) + self.config.append_static_log("ID_AUDIO_ID: "+str(stream_number)) # increment the stream_number counter in this case to also count # subtitles and other stream types - if (command[-3:] == "_ID"): + if (command == "ID_VIDEO_ID") or (command == "ID_AUDIO_ID") or (command == "ID_SUBTITLE_ID"): stream_number += 1 if (check_audio): @@ -170,4 +180,4 @@ class mplayer(devedeng.executor.executor): if (self.video_streams == 0): return False else: - return True \ No newline at end of file + return True