From c1b1719914943389fd5172679ddc34e9ee17a78e Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 16 Aug 2018 23:09:40 -0700 Subject: [PATCH] Recreate the VT decoder if the display layer fails. Minor fix to Path class. --- app/path.h | 1 + app/streaming/video/ffmpeg-renderers/vt.mm | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/path.h b/app/path.h index 4b17ed83..4e0889f2 100644 --- a/app/path.h +++ b/app/path.h @@ -11,6 +11,7 @@ public: static void initialize(bool portable); +private: static QString s_LogDir; static QString s_BoxArtCacheDir; }; diff --git a/app/streaming/video/ffmpeg-renderers/vt.mm b/app/streaming/video/ffmpeg-renderers/vt.mm index e764065b..a7643e17 100644 --- a/app/streaming/video/ffmpeg-renderers/vt.mm +++ b/app/streaming/video/ffmpeg-renderers/vt.mm @@ -45,11 +45,15 @@ public: OSStatus status; CVPixelBufferRef pixBuf = reinterpret_cast(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