summaryrefslogtreecommitdiff
path: root/codecs/codec_zap.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2006-06-24 19:43:31 +0000
committerKevin P. Fleming <kpfleming@digium.com>2006-06-24 19:43:31 +0000
commite61d3d91f37f8b5b2fbcd30c2d3d0ba3abd5478f (patch)
treec9ee092b1529897cefb9171ca38ad1c5f74d293a /codecs/codec_zap.c
parentdf0ba5ff8b3199c9536a0d8f1f639ef279a93394 (diff)
The Eurostar Commit! (it's amazing how much work you can get done on a 150 minute train ride from Paris to London <G>)
support the new location for zaptel.h and tonezone.h use the dependency information output by menuselect to build Makefile rules for each module for header files and libraries combine the common rules into a top-level Makefile.rules file remove all (now) unnecessary stuff from subdir Makefiles change translator API so that the newpvt() callback returns an int instead of a pointer (it no longer allocates memory) alphabetize --with-<foo> options in configure script enhance Net-SNMP support in configure script to provide a --with-netsnmp option fix support for --with-pq so that if pg-config is not found when --with-pq is specified, an error will be generated add 'optional package' usage to modules now that menuselect can output it allow res_snmp to build by default, since the new loader changes coming soon will solve the function naming problem (and users can disable it via menuselect anyway) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'codecs/codec_zap.c')
-rw-r--r--codecs/codec_zap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/codecs/codec_zap.c b/codecs/codec_zap.c
index cad97c475..e7ece201d 100644
--- a/codecs/codec_zap.c
+++ b/codecs/codec_zap.c
@@ -43,7 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <sys/ioctl.h>
#include <errno.h>
#include <sys/mman.h>
-#include <linux/zaptel.h>
+#include <zaptel.h>
#include "asterisk/lock.h"
#include "asterisk/translate.h"
@@ -162,7 +162,7 @@ static void zap_destroy(struct ast_trans_pvt *pvt)
close(ztp->fd);
}
-static struct ast_trans_pvt *zap_translate(struct ast_trans_pvt *pvt, int dest, int source)
+static int zap_translate(struct ast_trans_pvt *pvt, int dest, int source)
{
/* Request translation through zap if possible */
int fd;
@@ -171,13 +171,13 @@ static struct ast_trans_pvt *zap_translate(struct ast_trans_pvt *pvt, int dest,
struct zt_transcode_header *hdr;
if ((fd = open("/dev/zap/transcode", O_RDWR)) < 0)
- return NULL;
+ return -1;
if ((hdr = mmap(NULL, sizeof(*hdr), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0)) == MAP_FAILED) {
ast_log(LOG_ERROR, "Memory Map failed for transcoding (%s)\n", strerror(errno));
close(fd);
- return NULL;
+ return -1;
}
if (hdr->magic != ZT_TRANSCODE_MAGIC) {
@@ -185,7 +185,7 @@ static struct ast_trans_pvt *zap_translate(struct ast_trans_pvt *pvt, int dest,
munmap(hdr, sizeof(*hdr));
close(fd);
- return NULL;
+ return -1;
}
hdr->srcfmt = (1 << source);
@@ -195,17 +195,17 @@ static struct ast_trans_pvt *zap_translate(struct ast_trans_pvt *pvt, int dest,
munmap(hdr, sizeof(*hdr));
close(fd);
- return NULL;
+ return -1;
}
ztp = pvt->pvt;
ztp->fd = fd;
ztp->hdr = hdr;
- return pvt;
+ return 0;
}
-static void *zap_new(struct ast_trans_pvt *pvt)
+static int zap_new(struct ast_trans_pvt *pvt)
{
return zap_translate(pvt, pvt->t->dstfmt, pvt->t->srcfmt);
}