Retry/restart streams with IDLE/ERROR result
If playing a m3u8 stream and the stream drops due to buffering or other issue, log output is something like this:
2020-01-03T21:08:15+01:00 state BUFFERING status.IdleReason
2020-01-03T21:08:19+01:00 state PLAYING status.IdleReason
2020-01-03T21:16:07+01:00 state BUFFERING status.IdleReason
2020-01-03T21:16:10+01:00 state PLAYING status.IdleReason
2020-01-03T21:21:47+01:00 state BUFFERING status.IdleReason
2020-01-03T21:21:52+01:00 state PLAYING status.IdleReason
2020-01-03T21:22:03+01:00 state IDLE status.IdleReason ERROR
At which point, when ERROR is reached, the only way to recover is CTRL+C/restart. Handling could be added to issue a retry with backoff (the only real use for fibonacci :)), and reset the retry counter to 0 after we would again get state BUFFERING/PLAYING.
Edit: might be wrong about CTRL+C, there seems to be some kind of timeout so it will exit after some time.
Is the stream coming from go-chromecast or from an external service? Do you have a code snippet of where you have the debug statement being printed?
I don't know why this would be happening, I can't see anywhere that go-chromecast will exit due to IdleReason being ERROR. This is the only code I can think of that would prematurely exit a stream, but not sure if this is the culprit, but I suspect this could be where you can add a retry from: https://github.com/vishen/go-chromecast/blob/master/application/application.go#L155-L169