Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.5 KiB

--- opal-3.6.8.orig/plugins/audio/celt/celtcodec.c 2010-05-27 08:52:43.000000000 +0200
+++ opal-3.6.8/plugins/audio/celt/celtcodec.c 2011-12-30 14:58:55.852605998 +0100
@@ -52,16 +52,11 @@
{
int error = 0;
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- celt->mode = celt_mode_create(codec->sampleRate, 1, codec->parm.audio.samplesPerFrame, &error);
-#else
celt->mode = celt_mode_create(codec->sampleRate, codec->parm.audio.samplesPerFrame, &error);
-#endif
if (celt->mode == NULL) {
return FALSE;
}
- celt_mode_info(celt->mode, CELT_GET_FRAME_SIZE, &celt->frame_size);
celt->bytes_per_packet = (codec->bitsPerSec * celt->frame_size/codec->sampleRate + 4) / 8;
return TRUE;
@@ -78,11 +73,7 @@
return NULL;
}
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- celt->encoder_state = celt_encoder_create(celt->mode);
-#else
- celt->encoder_state = celt_encoder_create(celt->mode, 1, NULL);
-#endif
+ celt->encoder_state = celt_encoder_create_custom(celt->mode, 1, NULL);
if (celt->encoder_state == NULL ) {
celt_mode_destroy(celt->mode);
free(celt);
@@ -104,11 +95,7 @@
return NULL;
}
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- celt->decoder_state = celt_decoder_create(celt->mode);
-#else
- celt->decoder_state = celt_decoder_create(celt->mode, 1, NULL);
-#endif
+ celt->decoder_state = celt_decoder_create_custom(celt->mode, 1, NULL);
if (celt->decoder_state == NULL ) {
celt_mode_destroy(celt->mode);
free(celt);
@@ -146,7 +133,7 @@
unsigned int * flag)
{
CELTContext *celt = (CELTContext *)context;
- unsigned byteCount;
+ int byteCount;
if (*fromLen < codec->parm.audio.samplesPerFrame*sizeof(short))
return FALSE;
@@ -154,16 +141,10 @@
if (*toLen < celt->bytes_per_packet)
return FALSE;
-#ifdef HAVE_CELT_0_4_OR_SOONER
- byteCount = celt_encode(celt->encoder_state, (celt_int16_t *)fromPtr, (char *)toPtr, celt->bytes_per_packet);
-#elif HAVE_CELT_0_5_0_OR_0_6_0
- byteCount = celt_encode(celt->encoder_state, (celt_int16_t *)fromPtr, NULL, (char *)toPtr, celt->bytes_per_packet);
-#else
- byteCount = celt_encode(celt->encoder_state, (void *)fromPtr, NULL, (unsigned char *)toPtr, celt->bytes_per_packet);
-#endif
- if (byteCount < 0) {
- return 0;
- }
+ byteCount = celt_encode(celt->encoder_state, (const celt_int16 *)fromPtr, *fromLen/2, (unsigned char *)toPtr, celt->bytes_per_packet);
+ if (byteCount < 0)
+ return 0;
+
*toLen = byteCount;
*fromLen = codec->parm.audio.samplesPerFrame*sizeof(short);
@@ -187,11 +168,7 @@
if (*fromLen == 0)
return FALSE;
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
- if (celt_decode(celt->decoder_state, (char *)fromPtr, *fromLen, (short *)toPtr) < 0)
-#else
- if (celt_decode(celt->decoder_state, (unsigned char *)fromPtr, *fromLen, (short *)toPtr) < 0)
-#endif
+ if (celt_decode(celt->decoder_state, (unsigned char *)fromPtr, *fromLen, (short *)toPtr, *toLen) < 0)
return 0;
*toLen = codec->parm.audio.samplesPerFrame*sizeof(short);
@@ -207,7 +184,7 @@
void * parm,
unsigned * parmLen)
{
-#if defined (HAVE_CELT_0_4_OR_SOONER) || defined (HAVE_CELT_0_5_0_OR_0_6_0)
+#if CELT_VERSION<700
if (parmLen == NULL || parm == NULL || *parmLen != sizeof(char *))
#else
if (parmLen == NULL || parm == NULL || *parmLen != sizeof(unsigned char *))