Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
24db0454
Commit
24db0454
authored
Jul 29, 2022
by
ziyue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不支持的协议直接抛异常, 防止非法推拉流:#1725
parent
54f400a6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
4 行增加
和
5 行删除
+4
-5
src/Player/PlayerBase.cpp
+1
-2
src/Pusher/PusherBase.cpp
+3
-3
没有找到文件。
src/Player/PlayerBase.cpp
查看文件 @
24db0454
...
@@ -56,10 +56,9 @@ PlayerBase::Ptr PlayerBase::createPlayer(const EventPoller::Ptr &poller, const s
...
@@ -56,10 +56,9 @@ PlayerBase::Ptr PlayerBase::createPlayer(const EventPoller::Ptr &poller, const s
}
else
if
(
end_with
(
url
,
".ts"
)
||
end_with
(
url_in
,
".ts"
))
{
}
else
if
(
end_with
(
url
,
".ts"
)
||
end_with
(
url_in
,
".ts"
))
{
return
PlayerBase
::
Ptr
(
new
TsPlayerImp
(
poller
),
releasePlayer
);
return
PlayerBase
::
Ptr
(
new
TsPlayerImp
(
poller
),
releasePlayer
);
}
}
return
PlayerBase
::
Ptr
(
new
TsPlayerImp
(
poller
),
releasePlayer
);
}
}
return
PlayerBase
::
Ptr
(
new
RtspPlayerImp
(
poller
),
releasePlayer
);
throw
std
::
invalid_argument
(
"not supported play schema:"
+
url_in
);
}
}
PlayerBase
::
PlayerBase
()
{
PlayerBase
::
PlayerBase
()
{
...
...
src/Pusher/PusherBase.cpp
查看文件 @
24db0454
...
@@ -19,14 +19,14 @@ namespace mediakit {
...
@@ -19,14 +19,14 @@ namespace mediakit {
PusherBase
::
Ptr
PusherBase
::
createPusher
(
const
EventPoller
::
Ptr
&
poller
,
PusherBase
::
Ptr
PusherBase
::
createPusher
(
const
EventPoller
::
Ptr
&
poller
,
const
MediaSource
::
Ptr
&
src
,
const
MediaSource
::
Ptr
&
src
,
const
std
::
string
&
strU
rl
)
{
const
std
::
string
&
u
rl
)
{
static
auto
releasePusher
=
[](
PusherBase
*
ptr
){
static
auto
releasePusher
=
[](
PusherBase
*
ptr
){
onceToken
token
(
nullptr
,[
&
](){
onceToken
token
(
nullptr
,[
&
](){
delete
ptr
;
delete
ptr
;
});
});
ptr
->
teardown
();
ptr
->
teardown
();
};
};
std
::
string
prefix
=
FindField
(
strU
rl
.
data
(),
NULL
,
"://"
);
std
::
string
prefix
=
FindField
(
u
rl
.
data
(),
NULL
,
"://"
);
if
(
strcasecmp
(
"rtsps"
,
prefix
.
data
())
==
0
)
{
if
(
strcasecmp
(
"rtsps"
,
prefix
.
data
())
==
0
)
{
return
PusherBase
::
Ptr
(
new
TcpClientWithSSL
<
RtspPusherImp
>
(
poller
,
std
::
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
return
PusherBase
::
Ptr
(
new
TcpClientWithSSL
<
RtspPusherImp
>
(
poller
,
std
::
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
...
@@ -44,7 +44,7 @@ PusherBase::Ptr PusherBase::createPusher(const EventPoller::Ptr &poller,
...
@@ -44,7 +44,7 @@ PusherBase::Ptr PusherBase::createPusher(const EventPoller::Ptr &poller,
return
PusherBase
::
Ptr
(
new
RtmpPusherImp
(
poller
,
std
::
dynamic_pointer_cast
<
RtmpMediaSource
>
(
src
)),
releasePusher
);
return
PusherBase
::
Ptr
(
new
RtmpPusherImp
(
poller
,
std
::
dynamic_pointer_cast
<
RtmpMediaSource
>
(
src
)),
releasePusher
);
}
}
return
PusherBase
::
Ptr
(
new
RtspPusherImp
(
poller
,
std
::
dynamic_pointer_cast
<
RtspMediaSource
>
(
src
)),
releasePusher
);
throw
std
::
invalid_argument
(
"not supported push schema:"
+
url
);
}
}
PusherBase
::
PusherBase
()
{
PusherBase
::
PusherBase
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论