aboutsummaryrefslogtreecommitdiffstats
path: root/addons/format_mp3.c
diff options
context:
space:
mode:
Diffstat (limited to 'addons/format_mp3.c')
-rw-r--r--addons/format_mp3.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/format_mp3.c b/addons/format_mp3.c
index ceb1accbb..d59411d6c 100644
--- a/addons/format_mp3.c
+++ b/addons/format_mp3.c
@@ -224,7 +224,7 @@ static struct ast_frame *mp3_read(struct ast_filestream *s, int *whennext)
p->offset += p->buflen;
delay = p->buflen/2;
s->fr.frametype = AST_FRAME_VOICE;
- s->fr.subclass.codec = AST_FORMAT_SLINEAR;
+ ast_format_set(&s->fr.subclass.format, AST_FORMAT_SLINEAR, 0);
AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, p->buflen);
s->fr.mallocd = 0;
s->fr.samples = delay;
@@ -293,10 +293,9 @@ static char *mp3_getcomment(struct ast_filestream *s)
return NULL;
}
-static const struct ast_format mp3_f = {
+static struct ast_format_def mp3_f = {
.name = "mp3",
.exts = "mp3",
- .format = AST_FORMAT_SLINEAR,
.open = mp3_open,
.write = mp3_write,
.rewrite = mp3_rewrite,
@@ -313,13 +312,14 @@ static const struct ast_format mp3_f = {
static int load_module(void)
{
+ ast_format_set(&mp3_f.format, AST_FORMAT_SLINEAR, 0);
InitMP3Constants();
- return ast_format_register(&mp3_f);
+ return ast_format_def_register(&mp3_f);
}
static int unload_module(void)
{
- return ast_format_unregister(name);
+ return ast_format_def_unregister(name);
}
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "MP3 format [Any rate but 8000hz mono is optimal]");