$OpenBSD: patch-src_mumble_CELTCodec_cpp,v 1.1.1.1 2013/10/01 10:28:44 dcoppa Exp $

Fix loading of CELT plugins; use celt from our tree

--- src/mumble/CELTCodec.cpp.orig	Sat Jun  1 23:16:31 2013
+++ src/mumble/CELTCodec.cpp	Wed Sep 25 16:09:11 2013
@@ -41,12 +41,6 @@
 #define RESOLVE(var) { * reinterpret_cast<void **>(&var) = static_cast<void *>(qlCELT.resolve(#var)); bValid = bValid && (var != NULL); }
 #endif
 
-#ifdef Q_OS_WIN
-extern "C" {
-	void __cpuid(int a[4], int b);
-};
-#endif
-
 CELTCodec::CELTCodec(const QString &version) {
 	bValid = false;
 	cmMode = NULL;
@@ -55,53 +49,9 @@ CELTCodec::CELTCodec(const QString &version) {
 	qlCELT.setLoadHints(QLibrary::ResolveAllSymbolsHint);
 
 	QStringList alternatives;
-#if defined(Q_OS_MAC)
-	alternatives << QString::fromLatin1("libcelt0.%1.dylib").arg(version);
-	alternatives << QString::fromLatin1("celt0.%1.dylib").arg(version);
-	alternatives << QString::fromLatin1("libcelt.%1.dylib").arg(version);
-	alternatives << QString::fromLatin1("celt.%1.dylib").arg(version);
-#elif defined(Q_OS_UNIX)
-	alternatives << QString::fromLatin1("libcelt0.so.%1").arg(version);
-	alternatives << QString::fromLatin1("libcelt.so.%1").arg(version);
-	alternatives << QString::fromLatin1("celt.so.%1").arg(version);
-#else
-	int cpuinfo[4];
-	__cpuid(cpuinfo, 1);
-	if (cpuinfo[3] & 0x02000000) {
-		if (cpuinfo[3] & 0x04000000) {
-			if (cpuinfo[2] & 0x00000001) {
-				alternatives << QString::fromLatin1("celt0.%1.sse3.dll").arg(version);
-			}
-			alternatives << QString::fromLatin1("celt0.%1.sse2.dll").arg(version);
-		}
-		alternatives << QString::fromLatin1("celt0.%1.sse.dll").arg(version);
-	}
+	alternatives << QString::fromLatin1("libcelt%1.so").arg(version);
 
-	alternatives << QString::fromLatin1("celt0.%1.dll").arg(version);
-#endif
 	foreach(const QString &lib, alternatives) {
-		qlCELT.setFileName(QApplication::instance()->applicationDirPath() + QLatin1String("/") + lib);
-		if (qlCELT.load()) {
-			bValid = true;
-			break;
-		}
-
-#ifdef Q_OS_MAC
-		qlCELT.setFileName(QApplication::instance()->applicationDirPath() + QLatin1String("/../Codecs/") + lib);
-		if (qlCELT.load()) {
-			bValid = true;
-			break;
-		}
-#endif
-
-#ifdef PLUGIN_PATH
-		qlCELT.setFileName(QLatin1String(MUMTEXT(PLUGIN_PATH) "/") + lib);
-		if (qlCELT.load()) {
-			bValid = true;
-			break;
-		}
-#endif
-
 		qlCELT.setFileName(lib);
 		if (qlCELT.load()) {
 			bValid = true;
