File 0003-Hack-backwards-compatibility-for-TurboJPEG-2.0.0.patch of Package droidcam

From 0f32243499c2c38b746605b8031ea01a731e8514 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Sat, 11 Jul 2020 07:30:28 +0200
Subject: [PATCH 3/3] Hack backwards compatibility for TurboJPEG < 2.0.0

---
 src/decoder.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/decoder.c b/src/decoder.c
index 69496b0..ad48f92 100644
--- a/src/decoder.c
+++ b/src/decoder.c
@@ -25,6 +25,15 @@ extern "C" {
 #include "libswscale/swscale.h"
 #include "speex/speex.h"
 
+#include "jconfig.h"
+#if LIBJPEG_TURBO_VERSION_NUMBER < 2000000
+#warning LIBJPEG_TURBO_VERSION too old for thread safe error handling
+#define tjGetErrorCode(handle) 0
+#define tjGetErrorStr2(handle) tjGetErrorStr()
+
+#define TJXOPT_COPYNONE 0
+#endif
+
 struct spx_decoder_s {
  snd_pcm_t *snd_handle;
  void *state;
-- 
2.27.0

openSUSE Build Service is sponsored by