* the GNU General Public License
*/
+#include <asterisk/lock.h>
#include <asterisk/channel.h>
#include <asterisk/file.h>
#include <asterisk/logger.h>
static struct ast_filestream *glist = NULL;
-static pthread_mutex_t mp3_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t mp3_lock = AST_MUTEX_INITIALIZER;
static int glistcnt = 0;
static char *name = "mp3";
s->adj -= (ms - delay);
s->adj -= 2;
}
- s->fr.timelen = delay;
+ s->fr.samples = delay * 8;
#if 0
ast_log(LOG_DEBUG, "delay is %d, adjusting by %d, as last was %d\n", delay, s->adj, ms);
#endif
{
/* Select our owner for this stream, and get the ball rolling. */
s->owner = c;
+ return 0;
+}
+
+static int mp3_play(struct ast_filestream *s)
+{
ast_read_callback(s);
return 0;
}
return 0;
}
+static int mp3_seek(struct ast_filestream *fs, long sample_offset, int whence)
+{
+ return -1;
+}
+
+static int mp3_trunc(struct ast_filestream *fs)
+{
+ return -1;
+}
+
+static long mp3_tell(struct ast_filestream *fs)
+{
+ return -1;
+}
+
static char *mp3_getcomment(struct ast_filestream *s)
{
return NULL;
mp3_open,
mp3_rewrite,
mp3_apply,
+ mp3_play,
mp3_write,
+ mp3_seek,
+ mp3_trunc,
+ mp3_tell,
mp3_read,
mp3_close,
mp3_getcomment);
tmp = glist;
while(tmp) {
if (tmp->owner)
- ast_softhangup(tmp->owner);
+ ast_softhangup(tmp->owner, AST_SOFTHANGUP_APPUNLOAD);
tmpl = tmp;
tmp = tmp->next;
free(tmpl);