mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-26 03:42:21 +08:00
Merge branch 'master' of github.com:ZLMediaKit/ZLMediaKit
This commit is contained in:
@@ -324,6 +324,12 @@ void HlsDemuxer::start(const EventPoller::Ptr &poller, TrackListener *listener)
|
||||
}
|
||||
|
||||
bool HlsDemuxer::inputFrame(const Frame::Ptr &frame) {
|
||||
//为了避免track准备时间过长, 因此在没准备好之前, 直接消费掉所有的帧
|
||||
if (!_delegate.isAllTrackReady()) {
|
||||
_delegate.inputFrame(frame);
|
||||
return true;
|
||||
}
|
||||
|
||||
//计算相对时间戳
|
||||
int64_t dts, pts;
|
||||
_stamp[frame->getTrackType()].revise(frame->dts(), frame->pts(), dts, pts);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include <cstdlib>
|
||||
#include "Util/base64.h"
|
||||
#include "HttpClient.h"
|
||||
#include "Common/config.h"
|
||||
|
||||
@@ -39,6 +40,13 @@ void HttpClient::sendRequest(const string &strUrl, float fTimeOutSec) {
|
||||
if (_path.empty()) {
|
||||
_path = "/";
|
||||
}
|
||||
auto pos = host.find('@');
|
||||
if (pos != string::npos) {
|
||||
//去除?后面的字符串
|
||||
auto authStr = host.substr(0, pos);
|
||||
host = host.substr(pos + 1, host.size());
|
||||
_header.emplace("Authorization", "Basic " + encodeBase64(authStr));
|
||||
}
|
||||
auto host_header = host;
|
||||
uint16_t port = atoi(FindField(host.data(), ":", NULL).data());
|
||||
if (port <= 0) {
|
||||
@@ -328,4 +336,4 @@ void HttpClient::checkCookie(HttpClient::HttpHeader &headers) {
|
||||
}
|
||||
}
|
||||
|
||||
} /* namespace mediakit */
|
||||
} /* namespace mediakit */
|
||||
|
||||
Reference in New Issue
Block a user