MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / readBuffer

Method readBuffer

framework/data_source/curl/CURLConnection.cpp:790–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790int CURLConnection::readBuffer(void *buf, size_t size)
791{
792 // double downloadSpeed;
793 // CURLcode re = curl_easy_getinfo(pEasyHandle->http_handle, CURLINFO_SPEED_DOWNLOAD, &downloadSpeed);
794 /*if (re == CURLE_OK)
795 av_log(mCurlhttpContext.hd,AV_LOG_DEBUG,"download speed is %f\n",downloadSpeed);*/
796 uint32_t want = std::min(RingBuffergetMaxReadSize(pRbuf), (uint32_t) size);
797
798 if (want > 0 && RingBufferReadData(pRbuf, (char *) buf, want) == want) {
799 mFilePos += want;
800 return want;
801 }
802
803 /* check if we finished prematurely */
804 if (!still_running &&
805 (mFileSize > 0 && mFilePos != mFileSize)) {
806 AF_LOGE("%s - Transfer ended before entire file was retrieved pos %lld, size %lld",
807 __FUNCTION__, mFilePos, mFileSize);
808 // return -1;
809 }
810
811 return 0;
812}
813
814void CURLConnection::updateSource(const string &location)
815{

Callers 2

ReadMethod · 0.45
ReadMethod · 0.45

Calls 3

minClass · 0.85
RingBuffergetMaxReadSizeFunction · 0.85
RingBufferReadDataFunction · 0.85

Tested by

no test coverage detected