From 051f76ff25d268a38b1bc34566b25a6b8f08b46a Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sun, 6 Jan 2013 04:04:01 +0100 Subject: play: handle ERR in addstr() crash with a temporary fix Hit this bug with latest mplayer while playing flac v1.2.1 encoded audio files: Traceback (most recent call last): self.w.addstr(s[:-1]) error: addstr() returned ERR For these files somehow wild duration is established, at the same time ogg123 reads them correctly. Use a lazy try-except clause to work around the crash until I have time to research it. --- play.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'play.py') diff --git a/play.py b/play.py index c9e0929..e210de4 100755 --- a/play.py +++ b/play.py @@ -118,8 +118,11 @@ class Window: def insstr(self, s): if not s: return - self.w.addstr(s[:-1]) - self.w.hline(ord(s[-1]), 1) # insch() work-around + try: + self.w.addstr(s[:-1]) + self.w.hline(ord(s[-1]), 1) # insch() work-around + except: + pass def __getattr__(self, name): return getattr(self.w, name) -- cgit v1.2.3