librespot-golang
librespot-golang copied to clipboard
Fix mac mismatch block
I'm not sure if this is a proper fix, but it passes along an error that is otherwise ignored, resulting in a block.
Just reproduced the error, but unfortunately it still blocks:
2018/11/14 18:01:05 received mac doesn't match
Unknown channel!
2018/11/14 18:01:05 received mac doesn't match
Unhandled cmd 0xdc
2018/11/14 18:01:05 received mac doesn't match
Unhandled cmd 0x3c
I think I narrowed down the issue - it seems that whenever I use the official Spotify on my PC, it 'invalidates' the session used by librespot, which causes the mac mismatch (although with a substantial delay). I tried shutting down all other Spotify clients and running libespot by itself for a full night, no problems.
This is a good idea, however the error returned should be handled by the parent function and close/restart the connection accordingly. I'm not sure reconnection is properly supported yet, so this is on hold
Indeed, I attempted a reconnect on error, but it seems like the function is not working properly.