GNOME Bugzilla – Bug 776609
adaptivedemux: actually retry on download errors
Last modified: 2017-05-29 07:57:10 UTC
The download error case was not taking into account the MAX_DOWNLOAD_ERROR_COUNT and could cause a long wait (for live streams waiting for a manifest update) or an immediate error (for non-live).
Created attachment 342607 [details] [review] adaptivedemux: retry fragment download MAX_DOWNLOAD_RETRY_COUNT times
Does retrying instantly the same fragment help for your use case? Wouldn't it get the same error a few times in a row and wait anyway?
Yes, retrying immediately helps. The waits with a certain manifest (that I unfortunately don't have access to anymore) would wait for the next fragment for hours.
Comment on attachment 342607 [details] [review] adaptivedemux: retry fragment download MAX_DOWNLOAD_RETRY_COUNT times Maybe it should wait a smaller time then, and only do the long wait if all else fails?
Retrying immediately is not ideal in any case
It's not immediate in any case, there are currently a few levels of waiting. The flow is as follows without this patch: 1. Request returns 4xx/5xx. 2 we may or may not be in the seek range: 2.1 outside seek range: none of the existing wait/retries apply here and we get to the changed line which returns EOS when the number of retries is less than the MAX DOWNLOAD_ERROR_COUNT (which is pretty much always true). 2.2 before seek range: we advance the fragment and try again 2.3 after seek range we wait until the seek range comes into play and try again. 3. EOS returns result in waiting for hours for manifest update. With the change: 1. The same 2.1 for the number of download errors < MAX DOWNLOAD_ERROR_COUNT, we return some kind of error which causes the download thread to try again later (after half the fragment duration). 2.2. for number of download errors >= MAX DOWNLOAD_ERROR_COUNT we return EOS which results in the manifest wait time again (i.e. hours). Also, with the change we don't double increment stream->download_error_count as that seems counterproductive to actually waiting a specified number of times.
commit 430a90df20881dcfb3b1d84e60f5e49549d11490 Author: Matthew Waters <matthew@centricular.com> Date: Fri Dec 2 17:51:57 2016 +1100 adaptivedemux: retry download MAX_DOWNLOAD_RETRY_COUNT times before erroring What we want is to retry downloading the fragment on 4xx/5xx errors however returning EOS will cause waiting for a manifest update for live (which may be a really long time) or stop everything for non-live. Change that to only return EOS/ERROR once we've reached the error limit. https://bugzilla.gnome.org/show_bug.cgi?id=776609