aboutsummaryrefslogtreecommitdiffstats
path: root/formats/format_vox.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-06 22:11:43 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-06 22:11:43 +0000
commit8b1f06abb435a2aa00d7b5d1e8dd1588bf895483 (patch)
tree8220ad163713cb38240eb18c24be25aa88b28865 /formats/format_vox.c
parent12b57158d66873fd353d3ae66662e205bd96debb (diff)
Version 0.3.0 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@608 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats/format_vox.c')
-rwxr-xr-xformats/format_vox.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/formats/format_vox.c b/formats/format_vox.c
index 94957e7d7..0a4c7c025 100755
--- a/formats/format_vox.c
+++ b/formats/format_vox.c
@@ -259,6 +259,7 @@ static void vox_close(struct ast_filestream *s)
ast_log(LOG_WARNING, "Freeing a filestream we don't seem to own\n");
close(s->fd);
free(s);
+ s = NULL;
}
static int ast_read_callback(void *data)
@@ -291,9 +292,9 @@ static int ast_read_callback(void *data)
s->signal += decode(s->buf[x] >> 4, &s->ssindex);
s->signal += decode(s->buf[x] & 0xf, &s->ssindex);
}
- s->fr.timelen = res / 4;
+ s->fr.samples = res * 2;
s->fr.datalen = res + 3;
- delay = s->fr.timelen;
+ delay = s->fr.samples / 8;
/* Lastly, process the frame */
if (ast_write(s->owner, &s->fr)) {
ast_log(LOG_WARNING, "Failed to write frame\n");
@@ -335,6 +336,11 @@ static int vox_apply(struct ast_channel *c, struct ast_filestream *s)
{
/* Select our owner for this stream, and get the ball rolling. */
s->owner = c;
+ return 0;
+}
+
+static int vox_play(struct ast_filestream *s)
+{
ast_read_callback(s);
return 0;
}
@@ -366,13 +372,32 @@ static char *vox_getcomment(struct ast_filestream *s)
return NULL;
}
+static int vox_seek(struct ast_filestream *fs, long sample_offset, int whence)
+{
+ return -1;
+}
+
+static int vox_trunc(struct ast_filestream *fs)
+{
+ return -1;
+}
+
+static long vox_tell(struct ast_filestream *fs)
+{
+ return -1;
+}
+
int load_module()
{
return ast_format_register(name, exts, AST_FORMAT_ADPCM,
vox_open,
vox_rewrite,
vox_apply,
+ vox_play,
vox_write,
+ vox_seek,
+ vox_trunc,
+ vox_tell,
vox_read,
vox_close,
vox_getcomment);