mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-29 22:32:23 +08:00
修复时间戳相关的bug
This commit is contained in:
@@ -35,21 +35,6 @@ using namespace std;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
static int getTimeInSDP(const string &sdp) {
|
||||
auto strRange = FindField(sdp.data(), "a=range:npt=", "\r\n");
|
||||
strRange.append(" ");
|
||||
auto iPos = strRange.find('-');
|
||||
if (iPos == string::npos) {
|
||||
return 0;
|
||||
}
|
||||
auto strStart = strRange.substr(0, iPos);
|
||||
auto strEnd = strRange.substr(iPos + 1);
|
||||
strEnd.pop_back();
|
||||
if (strStart == "now") {
|
||||
strStart = "0";
|
||||
}
|
||||
return atof(strEnd.data()) - atof(strStart.data());
|
||||
}
|
||||
RtspDemuxer::RtspDemuxer(const string& sdp) {
|
||||
loadSdp(SdpAttr(sdp));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user