Adds an error log when a potential video codec stall is detected #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have a production issue where we get infinite fast state flips between buffering and playing after a while.
So far, investigations have allowed us to understand that the issue seems that video frames do not get out of the codec. So after approximately 3 mins, the playhead gets to the end of the video buffer, so the player switches immediately to buffering. But at the same, the buffer is full (it's not being consumed anymore) so the buffering system flips it back to playing immediately. And that cycle is then repeated.
This PR adds a way to detect the codec stall situation, and send an error through the logger. The app will then be able to handle the error properly (potentially by restarting the playback automatically).
To do so, we just check if we've been waiting for a decoded buffer for a certain time without getting any.