From 6230a99360ac98e90ed8abb6285e42ba025c55e8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 14 Dec 2019 17:17:29 -0800 Subject: [PATCH] Fix colorspace conversion with SDL as frontend renderer --- app/streaming/video/ffmpeg-renderers/sdlvid.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/sdlvid.cpp b/app/streaming/video/ffmpeg-renderers/sdlvid.cpp index 508c9cc2..f483ec03 100644 --- a/app/streaming/video/ffmpeg-renderers/sdlvid.cpp +++ b/app/streaming/video/ffmpeg-renderers/sdlvid.cpp @@ -270,6 +270,11 @@ void SdlRenderer::renderFrame(AVFrame* frame) goto Exit; } + // av_hwframe_transfer_data() can nuke frame metadata, + // so anything other than width, height, and format must + // be set *after* calling av_hwframe_transfer_data(). + swFrame->colorspace = frame->colorspace; + frame = swFrame; }