# HG changeset patch # User mdd # Date 1511997652 -3600 # Node ID a1bc7549699265541e88d13e9c65da953ad5d344 # Parent 9bf1a8d2c26ef35aca4c43838bcd54823a414e37 div0 bug if we have frame errors at the video stream beginning diff -r 9bf1a8d2c26e -r a1bc75496992 ts2mkv.py --- a/ts2mkv.py Wed Nov 29 23:35:17 2017 +0100 +++ b/ts2mkv.py Thu Nov 30 00:20:52 2017 +0100 @@ -76,6 +76,8 @@ percent = frame_number * 100.00 / frames_total eta = frame_number / (time.time() - time_start) # eta is frames per second so far + if eta == 0: + eta = 1 eta = (frames_total - frame_number) / eta / 60 sys.stdout.write("\rFrame %i of %i, %.1f%% done, ETA %.0f minutes, " % ( frame_number, frames_total, percent, eta @@ -150,7 +152,7 @@ if idx == -1: return "" idx += 8 - self.info["msg_prepare"] += "Selecting: %s\n" % data + self.info["msg_prepare"] += "GetStreamIndex: %s\n" % data.strip() return data[idx:idx+3] def __get_movie_description(self): @@ -241,10 +243,14 @@ audio = filter_lines(audioall, "(eng):") aidx = self.get_stream_index( filter_lines(audio, "ac3")) - if aidx != "" and filter_lines(audio, "ac3").find(" 0 channels ") < 1: - # append english audio too! - print "Selecting english ac3 stream." - audiomap.append(aidx) + if aidx != "": + try: + filter_lines(audio, "ac3").index(" 0 channels") + print "Skipping english stream with 0 channels" + except ValueError: + # append english audio too! + print "Selecting english ac3 stream." + audiomap.append(aidx) if len(audiomap) == 0 and self.config["firstaudio"]: # append first audio stream as forced fallback aidx = self.get_stream_index(audioall)