mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
修复rtmps默认端口不对导致无法推/拉流问题 (#2996)
在使用rtmps推流或者拉流时,端口被默认设置成了1935,正确的端口应该是443.
This commit is contained in:
parent
22f5f56130
commit
a13b8417e5
@ -69,7 +69,7 @@ void RtmpPlayer::play(const string &url) {
|
|||||||
}
|
}
|
||||||
DebugL << host_url << " " << _app << " " << _stream_id;
|
DebugL << host_url << " " << _app << " " << _stream_id;
|
||||||
|
|
||||||
uint16_t port = 1935;
|
uint16_t port = start_with(url, "rtmps") ? 443 : 1935;
|
||||||
splitUrl(host_url, host_url, port);
|
splitUrl(host_url, host_url, port);
|
||||||
|
|
||||||
if (!(*this)[Client::kNetAdapter].empty()) {
|
if (!(*this)[Client::kNetAdapter].empty()) {
|
||||||
|
@ -82,7 +82,7 @@ void RtmpPusher::publish(const string &url) {
|
|||||||
}
|
}
|
||||||
DebugL << host_url << " " << _app << " " << _stream_id;
|
DebugL << host_url << " " << _app << " " << _stream_id;
|
||||||
|
|
||||||
uint16_t port = 1935;
|
uint16_t port = start_with(url, "rtmps") ? 443 : 1935;
|
||||||
splitUrl(host_url, host_url, port);
|
splitUrl(host_url, host_url, port);
|
||||||
|
|
||||||
weak_ptr<RtmpPusher> weakSelf = static_pointer_cast<RtmpPusher>(shared_from_this());
|
weak_ptr<RtmpPusher> weakSelf = static_pointer_cast<RtmpPusher>(shared_from_this());
|
||||||
|
@ -116,5 +116,6 @@ int domain(const string &file, const string &url) {
|
|||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
// 可以使用test_server生成的mp4文件
|
// 可以使用test_server生成的mp4文件
|
||||||
// 文件使用绝对路径,推流url支持rtsp和rtmp
|
// 文件使用绝对路径,推流url支持rtsp和rtmp
|
||||||
return domain("/Users/xiongziliang/Downloads/mp4/Quantum.mp4", "rtsp://127.0.0.1/live/rtsp_push");
|
// return domain("/Users/xiongziliang/Downloads/mp4/Quantum.mp4", "rtsp://127.0.0.1/live/rtsp_push");
|
||||||
|
return domain(argv[1], argv[2]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user