[asterisk-commits] branch file/coremedia - r7416 in /team/file/coremedia: ./ codecs/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Dec 9 19:01:44 CST 2005


Author: file
Date: Fri Dec  9 19:01:42 2005
New Revision: 7416

URL: http://svn.digium.com/view/asterisk?rev=7416&view=rev
Log:
Slight tweak and add something I use locally to the Makefile (only gets compiled if you have the right stuff...)

Modified:
    team/file/coremedia/codecs/Makefile
    team/file/coremedia/coremedia.c

Modified: team/file/coremedia/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/codecs/Makefile?rev=7416&r1=7415&r2=7416&view=diff
==============================================================================
--- team/file/coremedia/codecs/Makefile (original)
+++ team/file/coremedia/codecs/Makefile Fri Dec  9 19:01:42 2005
@@ -26,6 +26,11 @@
 ifneq ($(wildcard g723.1b/coder2.c),)
   MODG723+=codec_g723_1b.so
   LIBG723B=g723.1b/libg723b.a
+endif
+
+ifneq ($(wildcard g726/g72x.h),)
+  MODG726=codec_g726_josh.so
+  LIBG726=g726/libg726.a
 endif
 
 UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
@@ -68,7 +73,7 @@
   CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
 endif
 
-CODECS+=codec_gsm.so codec_ulaw.so codec_alaw.so
+CODECS+=$(MODG726) codec_gsm.so codec_ulaw.so codec_alaw.so
 
 all: depend $(CODECS)
 
@@ -76,9 +81,13 @@
 	rm -f *.so *.o .depend
 	[ ! -d g723.1 ] || $(MAKE) -C g723.1 clean
 	[ ! -d g723.1b ] || $(MAKE) -C g723.1b clean
+	[ ! -d g726 ] || $(MAKE) -C g726 clean
 	$(MAKE) -C gsm clean
 	$(MAKE) -C lpc10 clean
 	$(MAKE) -C ilbc clean
+
+$(LIBG726):
+	$(MAKE) -C g726 all
 
 $(LIBG723):
 	$(MAKE) -C g723.1 all
@@ -116,6 +125,9 @@
 codec_lpc10.so: codec_lpc10.o $(LIBLPC10)
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBLPC10) -lm
 
+codec_g726_josh.so: codec_g726_josh.o $(LIBG726)
+	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(LIBG726) -lm
+
 %.so : %.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
 

Modified: team/file/coremedia/coremedia.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/coremedia.c?rev=7416&r1=7415&r2=7416&view=diff
==============================================================================
--- team/file/coremedia/coremedia.c (original)
+++ team/file/coremedia/coremedia.c Fri Dec  9 19:01:42 2005
@@ -93,7 +93,6 @@
 /* Parsing helper functions */
 struct ast_coremedia_handle *ast_coremedia_parse_codec(char *codec)
 {
-	char tmp[128] = "";
 	char *codecs = NULL;
 	char *name = NULL, *bitrate2 = NULL, *samples2 = NULL;
 	int bitrate = 0, samples = 8000;
@@ -104,9 +103,7 @@
 	if (codec == NULL)
 		return NULL;
 
-	strncpy(tmp, codec, sizeof(tmp));
-
-	codecs = tmp;
+	codecs = ast_strdupa(codec);
 
 	/* The one time I've ever actually used a do loop for something */
 	do {



More information about the asterisk-commits mailing list