Merge branch 'master' of github.com:ZLMediaKit/ZLMediaKit

This commit is contained in:
xiongziliang 2022-06-04 11:08:13 +08:00
commit df9a9649b0
2 changed files with 30 additions and 22 deletions

View File

@ -378,7 +378,8 @@ void HlsPlayerImp::onPlayResult(const SockException &ex) {
}
void HlsPlayerImp::onShutdown(const SockException &ex) {
if (_demuxer) {
while (_demuxer) {
try {
std::weak_ptr<HlsPlayerImp> weak_self = static_pointer_cast<HlsPlayerImp>(shared_from_this());
static_pointer_cast<HlsDemuxer>(_demuxer)->pushTask([weak_self, ex]() {
auto strong_self = weak_self.lock();
@ -387,10 +388,13 @@ void HlsPlayerImp::onShutdown(const SockException &ex) {
strong_self->onShutdown(ex);
}
});
} else {
PlayerImp<HlsPlayer, PlayerBase>::onShutdown(ex);
return;
} catch (...) {
break;
}
}
PlayerImp<HlsPlayer, PlayerBase>::onShutdown(ex);
}
vector<Track::Ptr> HlsPlayerImp::getTracks(bool ready) const {
if (!_demuxer) {

View File

@ -45,7 +45,8 @@ void TsPlayerImp::onPlayResult(const SockException &ex) {
}
void TsPlayerImp::onShutdown(const SockException &ex) {
if (_demuxer) {
while (_demuxer) {
try {
std::weak_ptr<TsPlayerImp> weak_self = static_pointer_cast<TsPlayerImp>(shared_from_this());
static_pointer_cast<HlsDemuxer>(_demuxer)->pushTask([weak_self, ex]() {
auto strong_self = weak_self.lock();
@ -54,10 +55,13 @@ void TsPlayerImp::onShutdown(const SockException &ex) {
strong_self->onShutdown(ex);
}
});
} else {
PlayerImp<TsPlayer, PlayerBase>::onShutdown(ex);
return;
} catch (...) {
break;
}
}
PlayerImp<TsPlayer, PlayerBase>::onShutdown(ex);
}
vector<Track::Ptr> TsPlayerImp::getTracks(bool ready) const {
if (!_demuxer) {