无音频时生成静音音频,防止播放器加载画面太慢

修复MAC下SDL必须在主线程渲染的问题
This commit is contained in:
xiongziliang
2018-06-30 23:02:16 +08:00
parent ae5482ec61
commit 58b58418d6
5 changed files with 82 additions and 10 deletions

View File

@@ -42,6 +42,8 @@ using namespace ZL::Util;
#define REFRESH_EVENT (SDL_USEREVENT + 1)
#ifndef __MACH__
class SDLDisplayerHelper
{
public:
@@ -104,6 +106,8 @@ private:
};
#endif //__MACH__
class YuvDisplayer {
public:
YuvDisplayer(void *hwnd = nullptr,const char *title = "untitled"){
@@ -121,7 +125,9 @@ public:
},nullptr);
InfoL << "SDL_Init";
}, []() {
#ifndef __MACH__
SDLDisplayerHelper::Destory();
#endif
SDL_Quit();
});