diff options
Diffstat (limited to 'formats/format_ogg_vorbis.c')
-rw-r--r-- | formats/format_ogg_vorbis.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/formats/format_ogg_vorbis.c b/formats/format_ogg_vorbis.c index 9eb390066..6171491a8 100644 --- a/formats/format_ogg_vorbis.c +++ b/formats/format_ogg_vorbis.c @@ -45,6 +45,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/mod_format.h" #include "asterisk/module.h" +#include "asterisk/format_cache.h" /* * this is the number of samples we deal with. Samples are converted @@ -242,16 +243,6 @@ static int ogg_vorbis_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_ERROR, "This stream is not set up for writing!\n"); return -1; } - - if (f->frametype != AST_FRAME_VOICE) { - ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); - return -1; - } - if (f->subclass.format.id != AST_FORMAT_SLINEAR) { - ast_log(LOG_WARNING, "Asked to write non-SLINEAR frame (%s)!\n", - ast_getformatname(&f->subclass.format)); - return -1; - } if (!f->datalen) return -1; @@ -310,9 +301,6 @@ static struct ast_frame *ogg_vorbis_read(struct ast_filestream *fs, } /* initialize frame */ - fs->fr.frametype = AST_FRAME_VOICE; - ast_format_set(&fs->fr.subclass.format, AST_FORMAT_SLINEAR, 0); - fs->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&fs->fr, fs->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); out_buf = (char *) (fs->fr.data.ptr); /* SLIN data buffer */ @@ -435,7 +423,7 @@ static struct ast_format_def vorbis_f = { static int load_module(void) { - ast_format_set(&vorbis_f.format, AST_FORMAT_SLINEAR, 0); + vorbis_f.format = ast_format_slin; if (ast_format_def_register(&vorbis_f)) return AST_MODULE_LOAD_FAILURE; return AST_MODULE_LOAD_SUCCESS; |