mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
Merge branch 'master' of github.com:ZLMediaKit/ZLMediaKit
This commit is contained in:
commit
df9a9649b0
@ -378,18 +378,22 @@ void HlsPlayerImp::onPlayResult(const SockException &ex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HlsPlayerImp::onShutdown(const SockException &ex) {
|
void HlsPlayerImp::onShutdown(const SockException &ex) {
|
||||||
if (_demuxer) {
|
while (_demuxer) {
|
||||||
std::weak_ptr<HlsPlayerImp> weak_self = static_pointer_cast<HlsPlayerImp>(shared_from_this());
|
try {
|
||||||
static_pointer_cast<HlsDemuxer>(_demuxer)->pushTask([weak_self, ex]() {
|
std::weak_ptr<HlsPlayerImp> weak_self = static_pointer_cast<HlsPlayerImp>(shared_from_this());
|
||||||
auto strong_self = weak_self.lock();
|
static_pointer_cast<HlsDemuxer>(_demuxer)->pushTask([weak_self, ex]() {
|
||||||
if (strong_self) {
|
auto strong_self = weak_self.lock();
|
||||||
strong_self->_demuxer = nullptr;
|
if (strong_self) {
|
||||||
strong_self->onShutdown(ex);
|
strong_self->_demuxer = nullptr;
|
||||||
}
|
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 {
|
vector<Track::Ptr> HlsPlayerImp::getTracks(bool ready) const {
|
||||||
|
@ -45,18 +45,22 @@ void TsPlayerImp::onPlayResult(const SockException &ex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TsPlayerImp::onShutdown(const SockException &ex) {
|
void TsPlayerImp::onShutdown(const SockException &ex) {
|
||||||
if (_demuxer) {
|
while (_demuxer) {
|
||||||
std::weak_ptr<TsPlayerImp> weak_self = static_pointer_cast<TsPlayerImp>(shared_from_this());
|
try {
|
||||||
static_pointer_cast<HlsDemuxer>(_demuxer)->pushTask([weak_self, ex]() {
|
std::weak_ptr<TsPlayerImp> weak_self = static_pointer_cast<TsPlayerImp>(shared_from_this());
|
||||||
auto strong_self = weak_self.lock();
|
static_pointer_cast<HlsDemuxer>(_demuxer)->pushTask([weak_self, ex]() {
|
||||||
if (strong_self) {
|
auto strong_self = weak_self.lock();
|
||||||
strong_self->_demuxer = nullptr;
|
if (strong_self) {
|
||||||
strong_self->onShutdown(ex);
|
strong_self->_demuxer = nullptr;
|
||||||
}
|
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 {
|
vector<Track::Ptr> TsPlayerImp::getTracks(bool ready) const {
|
||||||
|
Loading…
Reference in New Issue
Block a user