Recreate the VT decoder if the display layer fails. Minor fix to Path class.

This commit is contained in:
Cameron Gutman 2018-08-16 23:09:40 -07:00
parent 9fbdd794b9
commit c1b1719914
2 changed files with 7 additions and 2 deletions

View file

@ -11,6 +11,7 @@ public:
static void initialize(bool portable);
private:
static QString s_LogDir;
static QString s_BoxArtCacheDir;
};

View file

@ -45,11 +45,15 @@ public:
OSStatus status;
CVPixelBufferRef pixBuf = reinterpret_cast<CVPixelBufferRef>(frame->data[3]);
// FIXME: Only on main thread
if (m_DisplayLayer.status == AVQueuedSampleBufferRenderingStatusFailed) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"Resetting failed AVSampleBufferDisplay layer");
setupDisplayLayer();
// Trigger the main thread to recreate the decoder
SDL_Event event;
event.type = SDL_RENDER_TARGETS_RESET;
SDL_PushEvent(&event);
return;
}
// If the format has changed or doesn't exist yet, construct it with the