Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37570224
en ru br
Репозитории ALT

Группа :: Звук
Пакет: bluez-alsa

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: bluez-alsa-4.0.0-alt-libfreeaptx.patch
Скачать


diff --git a/configure.ac b/configure.ac
index 92dc5ee..0350661 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,18 +103,20 @@ AM_COND_IF([ENABLE_AAC], [
 	AC_DEFINE([ENABLE_AAC], [1], [Define to 1 if AAC is enabled.])
 ])
 
-AC_ARG_WITH([libopenaptx],
-	[AS_HELP_STRING([--with-libopenaptx], [use libopenaptx by pali.rohar for apt-X (HD)])])
-AM_CONDITIONAL([WITH_LIBOPENAPTX], [test "x$with_libopenaptx" = "xyes"])
+AC_ARG_WITH([libfreeaptx],
+	[AS_HELP_STRING([--with-libfreeaptx], [use libfreeaptx by iamthehorker for apt-X (HD)])])
+AM_CONDITIONAL([WITH_LIBFREEAPTX], [test "x$with_libfreeaptx" = "xyes"])
+AM_COND_IF([WITH_LIBFREEAPTX], [
+		PKG_CHECK_MODULES([APTX], [libfreeaptx >= 0.1.1])
+		AC_DEFINE([WITH_LIBFREEAPTX], [1], [Define to 1 if libfreeaptx shall be used.])
+])
 
 AC_ARG_ENABLE([aptx],
 	[AS_HELP_STRING([--enable-aptx], [enable apt-X support])])
 AM_CONDITIONAL([ENABLE_APTX], [test "x$enable_aptx" = "xyes"])
 AM_COND_IF([ENABLE_APTX], [
-	AM_COND_IF([WITH_LIBOPENAPTX], [
-		PKG_CHECK_MODULES([APTX], [libopenaptx >= 0.2.0])
+	AM_COND_IF([WITH_LIBFREEAPTX], [
 		AC_DEFINE([HAVE_APTX_DECODE], [1], [Define to 1 if you have apt-X decode library.])
-		AC_DEFINE([WITH_LIBOPENAPTX], [1], [Define to 1 if libopenaptx shall be used.])
 	], [
 		PKG_CHECK_MODULES([APTX], [openaptx >= 1.2.0])
 		if test "$($PKG_CONFIG --variable=aptxdecoder openaptx)" = "true"; then
@@ -128,10 +130,8 @@ AC_ARG_ENABLE([aptx_hd],
 	[AS_HELP_STRING([--enable-aptx-hd], [enable apt-X HD support])])
 AM_CONDITIONAL([ENABLE_APTX_HD], [test "x$enable_aptx_hd" = "xyes"])
 AM_COND_IF([ENABLE_APTX_HD], [
-	AM_COND_IF([WITH_LIBOPENAPTX], [
-		PKG_CHECK_MODULES([APTX_HD], [libopenaptx >= 0.2.0])
+	AM_COND_IF([WITH_LIBFREEAPTX], [
 		AC_DEFINE([HAVE_APTX_HD_DECODE], [1], [Define to 1 if you have apt-X HD decode library.])
-		AC_DEFINE([WITH_LIBOPENAPTX], [1], [Define to 1 if libopenaptx shall be used.])
 	], [
 		PKG_CHECK_MODULES([APTX_HD], [openaptxhd >= 1.2.0])
 		if test "$($PKG_CONFIG --variable=aptxdecoder openaptxhd)" = "true"; then
@@ -359,12 +359,12 @@ AM_COND_IF([ALSA_1_1_2__1_1_3], [
 	AC_MSG_WARN([LIBASOUND_THREAD_SAFE=0 while using bluealsa PCM.])
 ])
 
-# notify user that using libopenaptx might be a good idea
+# notify user that using libfreeaptx might be a good idea
 AM_COND_IF([ENABLE_APTX_OR_APTX_HD], [
-AM_COND_IF([WITH_LIBOPENAPTX], [], [
+AM_COND_IF([WITH_LIBFREEAPTX], [], [
 	AC_MSG_NOTICE([       *** using apt-X (HD) via Qualcomm API ***])
 	AC_MSG_NOTICE([Enabled apt-X (HD) support requires encoder (and decoder)])
 	AC_MSG_NOTICE([library with a proprietary Qualcomm API. Please consider])
-	AC_MSG_NOTICE([using --with-libopenaptx option which will use a library])
+	AC_MSG_NOTICE([using --with-libfreeaptx option which will use a library])
 	AC_MSG_NOTICE([based on FFmpeg project with better decoding support.])
 ])])
diff --git a/src/codec-aptx.c b/src/codec-aptx.c
index 2e256e4..a3ecbb7 100644
--- a/src/codec-aptx.c
+++ b/src/codec-aptx.c
@@ -16,7 +16,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 
-#include <openaptx.h>
+#include <freeaptx.h>
 
 #include "shared/defs.h"
 #include "shared/log.h"
@@ -28,7 +28,7 @@
  * @returns On success, this function returns initialized apt-X encoder
  *   handler. On error, NULL is returned. */
 HANDLE_APTX aptxenc_init(void) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	return aptx_init(0);
 #else
 	APTXENC handle;
@@ -49,7 +49,7 @@ HANDLE_APTX aptxenc_init(void) {
  * @returns On success, this function returns initialized apt-X decoder
  *   handler. On error, NULL is returned. */
 HANDLE_APTX aptxdec_init(void) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	return aptx_init(0);
 #else
 	APTXDEC handle;
@@ -70,7 +70,7 @@ HANDLE_APTX aptxdec_init(void) {
  * @returns On success, this function returns initialized apt-X encoder
  *   handler. On error, NULL is returned. */
 HANDLE_APTX aptxhdenc_init(void) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	return aptx_init(1);
 #else
 	APTXENC handle;
@@ -91,7 +91,7 @@ HANDLE_APTX aptxhdenc_init(void) {
  * @returns On success, this function returns initialized apt-X decoder
  *   handler. On error, NULL is returned. */
 HANDLE_APTX aptxhddec_init(void) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	return aptx_init(1);
 #else
 	APTXDEC handle;
@@ -117,7 +117,7 @@ ssize_t aptxenc_encode(HANDLE_APTX handle, const int16_t *input, size_t samples,
 	if (samples < 8 || *len < 4)
 		return errno = EINVAL, -1;
 
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 
 	const uint8_t pcm[3 /* 24bit */ * 8 /* 4 samples * 2 channels */] = {
 		0, input[0], input[0] >> 8, 0, input[1], input[1] >> 8,
@@ -159,7 +159,7 @@ ssize_t aptxdec_decode(HANDLE_APTX handle, const void *input, size_t len,
 	if (len < 4 || *samples < 8)
 		return errno = EINVAL, -1;
 
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 
 	uint8_t pcm[3 /* 24bit */ * 8 /* 4 samples * 2 channels */ * 2];
 	size_t written, dropped;
@@ -212,7 +212,7 @@ ssize_t aptxhdenc_encode(HANDLE_APTX handle, const int32_t *input, size_t sample
 	if (samples < 8 || *len < 6)
 		return errno = EINVAL, -1;
 
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 
 	const uint8_t pcm[3 /* 24bit */ * 8 /* 4 samples * 2 channels */] = {
 		input[0], input[0] >> 8, input[0] >> 16, input[1], input[1] >> 8, input[1] >> 16,
@@ -262,7 +262,7 @@ ssize_t aptxhddec_decode(HANDLE_APTX handle, const void *input, size_t len,
 	if (len < 6 || *samples < 8)
 		return errno = EINVAL, -1;
 
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 
 	uint8_t pcm[3 /* 24bit */ * 8 /* 4 samples * 2 channels */ * 2];
 	size_t written, dropped;
@@ -316,7 +316,7 @@ ssize_t aptxhddec_decode(HANDLE_APTX handle, const void *input, size_t len,
  *
  * @param handle Initialized encoder handler. */
 void aptxenc_destroy(HANDLE_APTX handle) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	aptx_finish(handle);
 #else
 	if (aptxbtenc_destroy != NULL)
@@ -332,7 +332,7 @@ void aptxenc_destroy(HANDLE_APTX handle) {
  *
  * @param handle Initialized decoder handler. */
 void aptxdec_destroy(HANDLE_APTX handle) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	aptx_finish(handle);
 #else
 	aptxbtdec_destroy(handle);
@@ -347,7 +347,7 @@ void aptxdec_destroy(HANDLE_APTX handle) {
  *
  * @param handle Initialized encoder handler. */
 void aptxhdenc_destroy(HANDLE_APTX handle) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	aptx_finish(handle);
 #else
 	if (aptxhdbtenc_destroy != NULL)
@@ -363,7 +363,7 @@ void aptxhdenc_destroy(HANDLE_APTX handle) {
  *
  * @param handle Initialized decoder handler. */
 void aptxhddec_destroy(HANDLE_APTX handle) {
-#if WITH_LIBOPENAPTX
+#if WITH_LIBFREEAPTX
 	aptx_finish(handle);
 #else
 	aptxhdbtdec_destroy(handle);
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin