VPAAMP-501: avoid generating "download failed" event prematurely while retrying#1573
Open
Vinish100 wants to merge 1 commit into
Open
VPAAMP-501: avoid generating "download failed" event prematurely while retrying#1573Vinish100 wants to merge 1 commit into
Vinish100 wants to merge 1 commit into
Conversation
… we are retrying Reason for change: Added retry support if the manifest is corrupted/un-supported. Avoid sending error event when the manifest update callback fails to get a good manifest Test Procedure: Fail manifest downloads occasionally and confirm playback is uninterrupted. Confirm once buffer runs dry a media error event is sent. Risks: Medium Signed-off-by: Vinish100 <vinish.balan@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent AAMP from emitting a premature “download failed”/manifest error event during MPD refresh failures while the downloader is still retrying, so established playback can continue uninterrupted until buffering actually fails.
Changes:
- Update
MPDUpdateCallbackExec()to stop firing immediate error/download-failed events on refresh failure and instead log + continue using the prior manifest. - Add/extend a fast-retry loop in the MPD downloader so refresh failures (including parse/content errors) trigger a 500ms retry cadence rather than exiting or waiting a full interval.
- Minor cleanup/formatting adjustments in MPD manifest fetch / FOG handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| fragmentcollector_mpd.cpp | Avoids sending error events during MPD refresh failures; keeps playback using the previous manifest while logging/recording FOG reason. |
| AampMPDDownloader.cpp | Implements/extends fast retry behavior for refresh failures and refines logging; however currently includes a stray \ line that should be removed. |
Comment on lines
409
to
413
| mMPDData->mLastPlaylistDownloadTimeMs = aamp_GetCurrentTimeMS(); | ||
| mMPDData->parseMPD(); | ||
| \ | ||
| if(firstDownload) | ||
| { |
| aamp->mFogTSBEnabled) | ||
| { | ||
| if (http_error == 512 ) | ||
| for ( std::string header : tmpManifestDnldRespPtr->mMPDDownloadResponse->mResponseHeader ) |
Comment on lines
+531
to
+544
| if (!firstDownload && | ||
| mMPDData->mMPDStatus != AAMPStatusType::eAAMPSTATUS_OK && | ||
| !mReleaseCalled) | ||
| { | ||
| AAMPLOG_WARN("Refresh after 500ms to handle a manifest timeout error."); | ||
| //Forcefully go with 500 ms refresh after a download failure | ||
| mRefreshInterval = MIN_DELAY_BETWEEN_PLAYLIST_UPDATE_MS; | ||
| downloadFailed = true; | ||
| refreshNeeded = waitForRefreshInterval(mRefreshInterval); | ||
| } | ||
| else if(!firstDownload && !IS_HTTP_SUCCESS(mMPDData->mMPDDownloadResponse->iHttpRetValue) && !mReleaseCalled) | ||
| { | ||
| // Other download failures (e.g. curl 56 CURLE_RECV_ERROR, transient HTTP errors) | ||
| // during an established live session: keep the refresh loop alive so the next | ||
| // manifest fetch is attempted rather than killing the downloader thread. | ||
| // Use 500ms fast-retry (same as timeout/COULDNT_CONNECT) to minimise buffer impact | ||
| // on LLD streams; mRefreshInterval is not permanently overwritten. | ||
| uint32_t fastRetry = MIN_DELAY_BETWEEN_PLAYLIST_UPDATE_MS; | ||
| AAMPLOG_WARN("Manifest download error [%d], will retry after %ums.", mMPDData->mMPDDownloadResponse->iHttpRetValue, fastRetry); | ||
| const uint32_t fastRetryMs = MIN_DELAY_BETWEEN_PLAYLIST_UPDATE_MS; | ||
| bool isTimeoutOrConnectionFailure = IsCurlTimeoutFailure(mMPDData->mMPDDownloadResponse->iHttpRetValue) | ||
| || (CURLE_COULDNT_CONNECT == mMPDData->mMPDDownloadResponse->iHttpRetValue); | ||
| AAMPLOG_WARN("Manifest %s [%d], fast retry after %ums.", | ||
| isTimeoutOrConnectionFailure ? "timeout/connection failure" : "download error", | ||
| mMPDData->mMPDDownloadResponse->iHttpRetValue, fastRetryMs); | ||
|
|
||
| downloadFailed = true; | ||
| refreshNeeded = waitForRefreshInterval(fastRetry); | ||
| refreshNeeded = waitForRefreshInterval(fastRetryMs); | ||
| // Note: mRefreshInterval unchanged; normal refresh cadence resumes after recovery |
Comment on lines
+531
to
+533
| if (!firstDownload && | ||
| mMPDData->mMPDStatus != AAMPStatusType::eAAMPSTATUS_OK && | ||
| !mReleaseCalled) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reason for change: Added retry support if the manifest is corrupted/un-supported. Avoid sending error event when the manifest update callback fails to get a good manifest
Test Procedure: Fail manifest downloads occasionally and confirm playback is uninterrupted. Confirm once buffer runs dry a media error event is sent. Risks: Medium