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
d2c64b1f
Commit
d2c64b1f
authored
2 years ago
by
xiongguangjie
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
613aae8b
918b1fce
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
10 行删除
+12
-10
src/Http/HlsPlayer.cpp
+6
-5
src/Http/TsplayerImp.cpp
+6
-5
没有找到文件。
src/Http/HlsPlayer.cpp
查看文件 @
d2c64b1f
...
...
@@ -380,10 +380,14 @@ void HlsPlayerImp::onPlayResult(const SockException &ex) {
void
HlsPlayerImp
::
onShutdown
(
const
SockException
&
ex
)
{
while
(
_demuxer
)
{
try
{
//shared_from_this()可能抛异常
std
::
weak_ptr
<
HlsPlayerImp
>
weak_self
=
static_pointer_cast
<
HlsPlayerImp
>
(
shared_from_this
());
if
(
_decoder
)
{
_decoder
->
flush
();
}
//等待所有frame flush输出后,再触发onShutdown事件
static_pointer_cast
<
HlsDemuxer
>
(
_demuxer
)
->
pushTask
([
weak_self
,
ex
]()
{
auto
strong_self
=
weak_self
.
lock
();
if
(
strong_self
)
{
if
(
auto
strong_self
=
weak_self
.
lock
())
{
strong_self
->
_demuxer
=
nullptr
;
strong_self
->
onShutdown
(
ex
);
}
...
...
@@ -393,9 +397,6 @@ void HlsPlayerImp::onShutdown(const SockException &ex) {
break
;
}
}
if
(
_decoder
)
{
_decoder
->
flush
();
}
PlayerImp
<
HlsPlayer
,
PlayerBase
>::
onShutdown
(
ex
);
}
...
...
This diff is collapsed.
Click to expand it.
src/Http/TsplayerImp.cpp
查看文件 @
d2c64b1f
...
...
@@ -47,10 +47,14 @@ void TsPlayerImp::onPlayResult(const SockException &ex) {
void
TsPlayerImp
::
onShutdown
(
const
SockException
&
ex
)
{
while
(
_demuxer
)
{
try
{
//shared_from_this()可能抛异常
std
::
weak_ptr
<
TsPlayerImp
>
weak_self
=
static_pointer_cast
<
TsPlayerImp
>
(
shared_from_this
());
if
(
_decoder
)
{
_decoder
->
flush
();
}
//等待所有frame flush输出后,再触发onShutdown事件
static_pointer_cast
<
HlsDemuxer
>
(
_demuxer
)
->
pushTask
([
weak_self
,
ex
]()
{
auto
strong_self
=
weak_self
.
lock
();
if
(
strong_self
)
{
if
(
auto
strong_self
=
weak_self
.
lock
())
{
strong_self
->
_demuxer
=
nullptr
;
strong_self
->
onShutdown
(
ex
);
}
...
...
@@ -60,9 +64,6 @@ void TsPlayerImp::onShutdown(const SockException &ex) {
break
;
}
}
if
(
_decoder
)
{
_decoder
->
flush
();
}
PlayerImp
<
TsPlayer
,
PlayerBase
>::
onShutdown
(
ex
);
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论