I'm writing a module which uses Stream.createInstance() and stream.play() to create and publish a stream.
If an exception occurs in the Stream thread, I want to be able to catch it and close the stream cleanly. It's not possible to capture it from my module code because it's in a different thread.
For example, at the moment, if an mp3 file is corrupt or missing the thread goes into an infinite loop:
How can I catch exceptions in this thread?INFO server comment - Stream.switch[liveplayer/development/1234]: index: 1 name:mp3:4414132145.mp3 start:0 length:-1
ERROR server comment - open: java.io.FileNotFoundException: /tmp/content/4414132145.mp3 (No such file or directory)
There is no listener that seems useful, so I suspect I need to override run() or something similar?