From b0223a7e291fc9d65a2c2b51b410c8288fdd81bd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Anthony=20L=C3=A9onard?=
 <anthony.leonard@savoirfairelinux.com>
Date: Fri, 19 Jan 2018 13:53:01 -0500
Subject: [PATCH] fix color channels on macOS

Incorrect condition was leading to bad pixel format conversion before
sending frames to client on macOS (BGR instead of correct RGB).

Change-Id: Ie76a488c4151d00249ed1adb5b0b02e43d2972eb
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
---
 src/media/video/sinkclient.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/media/video/sinkclient.cpp b/src/media/video/sinkclient.cpp
index 4df1a54663..129622fd47 100644
--- a/src/media/video/sinkclient.cpp
+++ b/src/media/video/sinkclient.cpp
@@ -343,11 +343,12 @@ SinkClient::update(Observable<std::shared_ptr<VideoFrame>>* /*obs*/,
         VideoScaler scaler;
         const int width = f.width();
         const int height = f.height();
-#if (defined(__ANDROID__) || (defined(__APPLE__)) && !defined(TARGET_OS_IPHONE))
+#if defined(__ANDROID__) || (defined(__APPLE__) && !TARGET_OS_IPHONE)
         const int format = VIDEO_PIXFMT_RGBA;
 #else
         const int format = VIDEO_PIXFMT_BGRA;
 #endif
+
         const auto bytes = videoFrameSize(format, width, height);
 
         if (bytes > 0) {
-- 
GitLab