Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion MediaStreamContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,14 @@ void MediaStreamContext::OnFragmentDownloadFailed(DownloadInfoPtr dlInfo)
}
else
{
AAMPLOG_WARN("%s StreamAbstractionAAMP_MPD::Already at the lowest profile, skipping segment at pos:%lf dur:%lf disc:%d", name, dlInfo->pts, dlInfo->fragmentDurationSec, dlInfo->isDiscontinuity);
if (context->IsCurrentProfileLowest())
{
AAMPLOG_WARN("%s StreamAbstractionAAMP_MPD::Already at the lowest profile, skipping segment at pos:%lf dur:%lf disc:%d", name, dlInfo->pts, dlInfo->fragmentDurationSec, dlInfo->isDiscontinuity);
}
else
{
AAMPLOG_WARN("%s StreamAbstractionAAMP_MPD::Rampdown not applied for error:%d; skipping segment at pos:%lf dur:%lf disc:%d", name, httpErrorCode, dlInfo->pts, dlInfo->fragmentDurationSec, dlInfo->isDiscontinuity);
}
if (!dlInfo->isInitSegment)
updateSkipPoint((dlInfo->pts + dlInfo->fragmentDurationSec), dlInfo->fragmentDurationSec);
auto timeBasedBufferManager = GetTimeBasedBufferManager();
Expand Down
23 changes: 22 additions & 1 deletion priv_aamp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4805,6 +4805,7 @@ bool PrivateInstanceAAMP::GetFile( std::string remoteUrl, AampMediaType mediaTyp

downloadTimeMS = (int)(tEndTime - tStartTime);
bool loopAgain = false;
bool isSingleRetryCurlError = false;
if (res == CURLE_OK)
{ // all data collected
if( memcmp(remoteUrl.c_str(), "file:", 5) == 0 )
Expand Down Expand Up @@ -4990,10 +4991,17 @@ bool PrivateInstanceAAMP::GetFile( std::string remoteUrl, AampMediaType mediaTyp
print_headerResponse(context.allResponseHeaders, mediaType);

}
isSingleRetryCurlError =
(res == CURLE_COULDNT_RESOLVE_HOST) ||
(res == CURLE_RECV_ERROR) ||
(res == CURLE_PARTIAL_FILE) ||
(res == CURLE_OPERATION_TIMEDOUT);

if (res == CURLE_COULDNT_CONNECT || IsCurlTimeoutFailure(res) ||
(isDownloadStalled &&
(eCURL_ABORT_REASON_LOW_BANDWIDTH_TIMEDOUT != abortReason)) ||
res == CURLE_SEND_ERROR)
res == CURLE_SEND_ERROR ||
isSingleRetryCurlError)
{

if(mpStreamAbstractionAAMP)
Expand Down Expand Up @@ -5057,6 +5065,11 @@ bool PrivateInstanceAAMP::GetFile( std::string remoteUrl, AampMediaType mediaTyp
break;
}
}
if (isSingleRetryCurlError && downloadAttempt >= 2)
{
loopAgain = false;
}

AAMPLOG_WARN("Download failed due to curl error %d or isDownloadStalled:%d Retrying:%d Attempt:%d abortReason:%d", res, isDownloadStalled, loopAgain && (downloadAttempt < maxDownloadAttempt), downloadAttempt, abortReason);
}

Expand Down Expand Up @@ -5204,6 +5217,14 @@ bool PrivateInstanceAAMP::GetFile( std::string remoteUrl, AampMediaType mediaTyp
}

}
if (loopAgain && (downloadAttempt < maxDownloadAttempt))
{
if (isSingleRetryCurlError)
{
interruptibleMsSleep(200);
}
}

if(!loopAgain)
break;
}
Expand Down
Loading