summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian C. (anrxc) <anrxc@sysphere.org>2013-01-06 04:04:01 +0100
committerAdrian C. (anrxc) <anrxc@sysphere.org>2013-01-06 04:04:01 +0100
commit051f76ff25d268a38b1bc34566b25a6b8f08b46a (patch)
treec2b53dc049acbcc3e1dcd51d20477ca29d97f563
parent2d70ee6b8cfced5ab1e6bcecf0e4a9ad14c7977c (diff)
downloadplay-051f76ff25d268a38b1bc34566b25a6b8f08b46a.tar.xz
play: handle ERR in addstr() crash with a temporary fixHEADmaster
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.
-rwxr-xr-xplay.py7
1 files changed, 5 insertions, 2 deletions
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)