diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-11-23 04:04:05 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2023-11-23 04:09:07 +0300 |
commit | 2ab53f3c5862704e24415f969b0d2be1c75b4e7a (patch) | |
tree | 6777630d4e1a24e4deb69e4eb18291c5fe77e3d7 | |
parent | ebd9c3c4ec2cfe2f08b4f700dcc5bcb2a8b4b847 (diff) | |
download | applause2-2ab53f3c5862704e24415f969b0d2be1c75b4e7a.tar.gz |
fixed playing of muxed streams and improved error reporting during Stream:play()
* This now preserves the original traceback.
-rw-r--r-- | applause.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/applause.lua b/applause.lua index 702913d..dcb283e 100644 --- a/applause.lua +++ b/applause.lua @@ -680,7 +680,7 @@ function Stream:play(first_port) local old_stepmul = collectgarbage("setstepmul", 100) local channels = self.channels - local _, err = pcall(Stream.foreach, self, function(frame) + local _, err = xpcall(self.foreach, debug.traceback, self, function(frame) -- Loop should get unrolled automatically for i = 1, channels do local sample = tonumber(frame[i]) @@ -704,7 +704,7 @@ function Stream:play(first_port) collectgarbage("setpause", old_pause) collectgarbage("setstepmul", old_stepmul) - if err then error(err, 2) end + if err then error(err, 0) end end --- Execute function for each frame generated by the stream. @@ -776,11 +776,11 @@ function Stream:jdump(opt, outfile) -- force some bulk calculations, so instead we always generate -- up to 1s of samples here. -- See also the "hotloop" optimization parameter. - local _, err = pcall(function() + local _, err = xpcall(function() for _ = 1, samplerate do tick() end - end) + end, debug.traceback) dump.off() - if err then error(err) end + if err then error(err, 0) end end --- Convert all values to Lua numbers |