bug fixed

This commit is contained in:
xiongziliang 2018-04-17 21:44:18 +08:00
parent bd04b2e2ab
commit 71174f906b
2 changed files with 29 additions and 31 deletions

View File

@ -123,7 +123,6 @@ public:
}, []() { }, []() {
SDLDisplayerHelper::Destory(); SDLDisplayerHelper::Destory();
SDL_Quit(); SDL_Quit();
InfoL << "SDL_Quit";
}); });
_title = title; _title = title;

View File

@ -59,6 +59,7 @@ int main(int argc, char *argv[]) {
} }
{
MediaPlayer::Ptr player(new MediaPlayer()); MediaPlayer::Ptr player(new MediaPlayer());
player->setOnPlayResult([](const SockException &ex) { player->setOnPlayResult([](const SockException &ex) {
InfoL << "OnPlayResult:" << ex.what(); InfoL << "OnPlayResult:" << ex.what();
@ -74,7 +75,8 @@ int main(int argc, char *argv[]) {
player->setOnVideoCB([&](const H264Frame &frame) { player->setOnVideoCB([&](const H264Frame &frame) {
SDLDisplayerHelper::Instance().doTask([&, frame]() { SDLDisplayerHelper::Instance().doTask([&, frame]() {
AVFrame *pFrame = nullptr; AVFrame *pFrame = nullptr;
bool flag = decoder.inputVideo((unsigned char *) frame.data.data(), frame.data.size(), frame.timeStamp, &pFrame); bool flag = decoder.inputVideo((unsigned char *) frame.data.data(), frame.data.size(), frame.timeStamp,
&pFrame);
if (flag) { if (flag) {
//DebugL << pFrame->pkt_pts; //DebugL << pFrame->pkt_pts;
displayer.displayYUV(pFrame); displayer.displayYUV(pFrame);
@ -84,14 +86,11 @@ int main(int argc, char *argv[]) {
}); });
EventPoller::Instance().runLoop(); EventPoller::Instance().runLoop();
}
static onceToken token(nullptr, []() {
UDPServer::Destory(); UDPServer::Destory();
EventPoller::Destory(); EventPoller::Destory();
AsyncTaskThread::Destory(); AsyncTaskThread::Destory();
Logger::Destory(); Logger::Destory();
});
return 0; return 0;
} }