Wait when trying to play a webstream while connecting to wifi#284
Wait when trying to play a webstream while connecting to wifi#284SZenglein wants to merge 1 commit into
Conversation
e434fe8 to
734a2c1
Compare
The code is simplified a lot. I removed the functions and variables that were never running anyway. The webstream command is now always accepted, and the error is handled inside the audio task. The audio task also blocks as long as a connection try is in progress. In addition to the code that did not work anyway, this should also fix the oversight that we want to immediately play a different webstream after starting, not only the last RFID.
734a2c1 to
ba8630b
Compare
|
Rebased this onto the latest dev, please have a look @tueddy @biologist79 :) There is one thing I am not 100% sure of: I'm basically blocking the Audio task for as long as WiFi is in the process of connecting. This hasn't caused any issues for me. With all the variables in the Audio loop it is also not easy to see what's going on, so maybe there is a better way to "do nothing". From the commit message:
|
The previous code had some issues. First of all, with DONT_ACCEPT_SAME_RFID_TWICE it would not work at all. But without a change, not even that works correctly (due to gTriedToConnectToHost never being set).
IMHO the code is simplified a lot. The whole control flow can be simplified if we just wait until a connection try hast completed.
The behavior will be slightly different. Most importantly, loading a webstream as the last played rfid now works consistently. Further, the error handling of playing a webstream while disconnected is shifted to the audio library and is handled like any other error.