inspirit / PS3EYEDriver

PS3EYE Camera Driver for OSX and Windows
Other
316 stars 92 forks source link

Addendum fix for rovarma's optimizations #22

Closed brendanwalker closed 8 years ago

brendanwalker commented 8 years ago

I just found one small issue with the latest camera driver that only manifests if you attempt to close and re-open a camera in the same process. In all our test apps we've never do this (open camera on start-up, close on shut-down). However in both psmove-ue4 and in psmove-unity5 we setup and teardown the tracker context whenever play is hit on the game. The USBMgr singleton has a exit_signaled flag used to tell the camera thread to exit. Since USBMgr stays around for the lifetime of the process, the exit_signaled flag wasn't getting reset after the camera thread finished shutting down. The next time you try to start up the camera thread it exits right away and then the FrameQueue::Dequeue() function will block forever waiting for a new frame that will never come. This fix simply that resets the flag after the thread closes. This was tested in psmove-unity5.

inspirit commented 8 years ago

thanx!