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
7a24a226
Commit
7a24a226
authored
Jul 02, 2022
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善推流判断逻辑
parent
87dd1c7f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
5 行增加
和
11 行删除
+5
-11
src/Rtmp/RtmpSession.cpp
+3
-7
src/Rtmp/RtmpSession.h
+0
-2
src/Rtsp/RtspSession.cpp
+2
-2
没有找到文件。
src/Rtmp/RtmpSession.cpp
查看文件 @
7a24a226
...
...
@@ -28,7 +28,7 @@ RtmpSession::~RtmpSession() {
}
void
RtmpSession
::
onError
(
const
SockException
&
err
)
{
bool
is_player
=
!
_push_src
;
bool
is_player
=
!
_push_src
_ownership
;
uint64_t
duration
=
_ticker
.
createdTime
()
/
1000
;
WarnP
(
this
)
<<
(
is_player
?
"RTMP播放器("
:
"RTMP推流器("
)
<<
_media_info
.
_vhost
<<
"/"
...
...
@@ -50,7 +50,7 @@ void RtmpSession::onError(const SockException& err) {
_push_src_ownership
=
nullptr
;
//延时10秒注销流
auto
push_src
=
std
::
move
(
_push_src
);
_delay_unregister_task
=
getPoller
()
->
doDelayTask
(
_continue_push_ms
,
[
push_src
]()
{
return
0
;
});
getPoller
()
->
doDelayTask
(
_continue_push_ms
,
[
push_src
]()
{
return
0
;
});
}
}
...
...
@@ -222,11 +222,7 @@ void RtmpSession::onCmd_deleteStream(AMFDecoder &dec) {
sendStatus
({
"level"
,
"status"
,
"code"
,
"NetStream.Unpublish.Success"
,
"description"
,
"Stop publishing."
});
//_push_src = nullptr;
//TraceL<<" delete stream";
if
(
_delay_unregister_task
){
_delay_unregister_task
->
cancel
();
}
_push_src
=
nullptr
;
throw
std
::
runtime_error
(
StrPrinter
<<
"Stop publishing"
<<
endl
);
}
...
...
src/Rtmp/RtmpSession.h
查看文件 @
7a24a226
...
...
@@ -103,8 +103,6 @@ private:
std
::
weak_ptr
<
RtmpMediaSource
>
_play_src
;
AMFValue
_push_metadata
;
RtmpMediaSourceImp
::
Ptr
_push_src
;
//延迟注销任务
toolkit
::
EventPoller
::
DelayTask
::
Ptr
_delay_unregister_task
;
std
::
shared_ptr
<
void
>
_push_src_ownership
;
RtmpMediaSource
::
RingType
::
RingReader
::
Ptr
_ring_reader
;
};
...
...
src/Rtsp/RtspSession.cpp
查看文件 @
7a24a226
...
...
@@ -60,7 +60,7 @@ RtspSession::~RtspSession() {
}
void
RtspSession
::
onError
(
const
SockException
&
err
)
{
bool
is_player
=
!
_push_src
;
bool
is_player
=
!
_push_src
_ownership
;
uint64_t
duration
=
_alive_ticker
.
createdTime
()
/
1000
;
WarnP
(
this
)
<<
(
is_player
?
"RTSP播放器("
:
"RTSP推流器("
)
<<
_media_info
.
_vhost
<<
"/"
...
...
@@ -868,7 +868,7 @@ void RtspSession::handleReq_Pause(const Parser &parser) {
void
RtspSession
::
handleReq_Teardown
(
const
Parser
&
parser
)
{
sendRtspResponse
(
"200 OK"
);
//
_push_src = nullptr;
_push_src
=
nullptr
;
throw
SockException
(
Err_shutdown
,
"recv teardown request"
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论