From 286dc585f26d6f4f471ed4ddc9df6c3e54c0b262 Mon Sep 17 00:00:00 2001 From: Eric von Bayer Date: Sun, 25 Oct 2009 10:42:24 -0700 Subject: [PATCH] Improved error checking. Assertion created error and therefor didn't end up being posted to the title. --- plugins/dvdvideo/dvdfolder.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/dvdvideo/dvdfolder.py b/plugins/dvdvideo/dvdfolder.py index c42c0c7..1cdbc7c 100644 --- a/plugins/dvdvideo/dvdfolder.py +++ b/plugins/dvdvideo/dvdfolder.py @@ -35,8 +35,8 @@ import os import re +import ilvuhack from dvdtitlestream import DVDTitleStream -from ilvuhack import ComputeRealSectors try: os.SEEK_SET @@ -582,16 +582,28 @@ class IFOVTSFile(DVDFileHandle): e = self.ReadU32() if i != 0: info['ilvu'] = True - - #if i == 0 or ( t1 & 0xF0 ) != 0x00: + + # If there are no ILVUs then just add the block if i == 0: ts.AddSectors( s, e ) + + # Otherwise, we need to let the ILVU hack compute the real + # sectors by partially decoding the VOB. else: try: - for [sr,er] in ComputeRealSectors( s, e, *ts.files() ): + for [sr,er] in ilvuhack.ComputeRealSectors( s, e, \ + *ts.files() ): ts.AddSectors( sr, er ) + except AssertionError, err: + raise DVDFormatError( \ + "Error processing ILVU block within title set "+\ + str(self.__num)+", program chain "+\ + str(info["number"])+": "+str(err) ) except: - raise DVDFormatError( "Error processing ILVU block within title set "+self.__num+", program chain "+info["number"] ) + raise DVDFormatError( \ + "Error processing ILVU block within title set "+\ + str(self.__num)+", program chain "+\ + str(info["number"]) ) info['stream'] = ts -- 2.11.4.GIT