Skip to content

Commit

Permalink
fix(curl_data_source): set file size to 0 when file size unknown
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Sep 27, 2020
1 parent 2e06ea3 commit 75879e7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions framework/data_source/curl/curl_data_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ int CurlDataSource::curl_connect(CURLConnection *pConnection, int64_t filePos)
if (length > 0.0) {
mFileSize = pConnection->tell() + (int64_t) length;
//AF_LOGE("file size is %lld\n",mFileSize);
} else {
mFileSize = 0;
}

// if (curlContext.fileSize == 0)
Expand Down Expand Up @@ -226,6 +228,7 @@ int CurlDataSource::Open(const string &url)
mLocation = (isRTMP ? (url + " live=1").c_str() : url.c_str());
// only change url, don,t change share and resolve
mPConnection->updateSource(mLocation);

int ret = curl_connect(mPConnection, rangeStart != INT64_MIN ? rangeStart : 0);
mOpenTimeMS = af_gettime_relative() / 1000 - mOpenTimeMS;

Expand Down

0 comments on commit 75879e7

Please sign in to comment.