ViveSoftware / ViveMediaDecoder

A high performance video decoding Unity plugin for Windows.
http://u3d.as/usf
Other
129 stars 36 forks source link

Bug - Unity freezes when stopping app while the decode is in INITIALIZING state #34

Open octaviancatlabuga opened 4 years ago

octaviancatlabuga commented 4 years ago

There seems to be a bug in the asset. Unity will freeze when I stop the app or change scene while the decoder is in INITIALIZING state.

To reproduce it:

  1. Set the Media Path to some random rtsp or rtmp address that are not working image
  2. Press play. (ViveMediaDecoder.cs in initDecoderAsync() will enter this while loop untill it will either fail or succeed) image
  3. Stop the app while the result is 0 (if step one is followed properly then it will be 0 forever)
  4. Unity will freeze and only a restart of Unity will help.

Solution I found Make sure you you don't run the StopDecoding() method when the decoder is in INITIALIZING state. To do that remove the =(equls) sign from StopDecoding() method in ViveMediaDecoder.cs. So far I dont see any problems with this solution, if I miss something please let me know. Snipaste_2019-11-27_10-42-58