Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recording Playback in Unity can't handle loopback #84

Open
NPatch opened this issue Aug 10, 2018 · 1 comment
Open

Recording Playback in Unity can't handle loopback #84

NPatch opened this issue Aug 10, 2018 · 1 comment

Comments

@NPatch
Copy link

NPatch commented Aug 10, 2018

For some reason, if loopback is switched on, with either Read or ReadPreloaded, it only rewinds properly 1-2 times.
In a debugging session, I got a System.IO.EndOfStreamException in formatter.Deserialize(skeletonStream) in RATKinectClient. There's no exception handling so at some point this results in exiting the thread and this is not handled in the "restart the stream" code.

Also ReadPreloaded is handled similarly to the Read mode which closes the streams and recreates them(allocation and everything).Isn't this wasteful, considering Preloaded has a memorystream that acts on a byte array that's already set? Could't we just stream.Seek(0,SeekOrigin.Begin)?

@NPatch
Copy link
Author

NPatch commented Aug 13, 2018

Apparently the loopback issue is because of the EndOfStreamException and some IOExceptions that can happen. There's no try/catch and it happens on one thread at a time, and not directly, so each time, the uncaught exceptions will crash the thread. And they can happen by any stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant