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
9f07f980
Commit
9f07f980
authored
Aug 16, 2018
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug
parent
015a61c4
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
2 行删除
+8
-2
ZLToolKit
+1
-1
src/Rtmp/RtmpSession.cpp
+7
-1
没有找到文件。
ZLToolKit
@
337e0ff2
Subproject commit
e54bd41dbf832ecf49358f4b877372808e8be587
Subproject commit
337e0ff2f9552b7fb0c1678598288194cc203bf9
src/Rtmp/RtmpSession.cpp
查看文件 @
9f07f980
...
...
@@ -242,6 +242,10 @@ void RtmpSession::doPlayResponse(const string &err,bool tryDelay,const std::shar
return
;
}
//切换到自己的线程再回复
//如果触发 kBroadcastMediaChanged 事件的线程与本RtmpSession绑定的线程相同,
//那么strongSelf->async操作可能是同步操作,
//通过指定参数may_sync为false确保 NoticeCenter::delListener操作延后执行,
//以便防止遍历事件监听对象map时做删除操作
strongSelf
->
async
([
task_id
,
weakSelf
,
pToken
,
media_info
](){
auto
strongSelf
=
weakSelf
.
lock
();
if
(
!
strongSelf
)
{
...
...
@@ -252,9 +256,11 @@ void RtmpSession::doPlayResponse(const string &err,bool tryDelay,const std::shar
strongSelf
->
doPlayResponse
(
""
,
false
,
pToken
);
//取消延时任务,防止多次回复
strongSelf
->
cancelDelyaTask
();
//取消事件监听
//在事件触发时不能在当前线程移除事件监听,否则会导致遍历map时做删除操作导致程序崩溃
NoticeCenter
::
Instance
().
delListener
(
task_id
,
Broadcast
::
kBroadcastMediaChanged
);
});
}
,
false
);
}
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论