Skip to content
Browse files

Changed "unterminated packet" to a non-critical error. Added logging …

…of exceptions for oggpatch GUI when checking files.
  • Loading branch information...
1 parent 481a970 commit dcc35e92b06fb06cd46bf4fd910974d8aeaf154f @Vultaire committed Jun 10, 2012
Showing with 10 additions and 6 deletions.
  1. +1 −1 r21buddy/logger.py
  2. +5 −4 r21buddy/oggpatch.py
  3. +4 −1 r21buddy/oggpatch_gui.py
View
2 r21buddy/logger.py
@@ -1,4 +1,4 @@
-import Queue
+import sys, Queue
class StdoutStderrLogger(object):
View
9 r21buddy/oggpatch.py
@@ -66,8 +66,6 @@ class NoMoreBitstreams(Exception):
pass
class UnexpectedContinuedPacket(Exception):
pass
-class UnterminatedPacket(Exception):
- pass
class InvalidFramingBit(Exception):
pass
@@ -204,11 +202,14 @@ def get_packets(pages):
if page.seg_table[j] < 255:
yield "".join(data)
data = []
-
+
if page.last_page:
break
if len(data) > 0:
- raise UnterminatedPacket(repr("".join(data)))
+ # I *think* the patch should still work - the patch
+ # operates on the page level, but this error is at the
+ # underlying packet; it shouldn't matter.
+ logger.error("WARNING: Unterminated packet detected, ignoring.")
self.pages = list(pages) # Needed to recreate stream with updated final page
View
5 r21buddy/oggpatch_gui.py
@@ -193,7 +193,10 @@ def execute(self):
self.restore_output()
elif mode == "check":
self.hijack_output()
- oggpatch.check_file(input_file, length, verbose=True)
+ try:
+ oggpatch.check_file(input_file, length, verbose=True)
+ except:
+ print traceback.format_exc()
self.restore_output()
else:
raise ValueError("Bad mode", mode)

0 comments on commit dcc35e9

Please sign in to comment.
Something went wrong with that request. Please try again.