diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-04 14:05:12 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-11-04 14:05:12 +0000 |
commit | 3bacd4082e2d3a2dd5b8b13635df956aa4f415cd (patch) | |
tree | dd3bc244b8a45aacb932109dc8c12d1f21769d55 /formats | |
parent | 1d3ce2ae5f81e30ec0704efe840bc2c9a24c7e8a (diff) |
Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats')
-rw-r--r-- | formats/format_g723.c | 4 | ||||
-rw-r--r-- | formats/format_g726.c | 8 | ||||
-rw-r--r-- | formats/format_g729.c | 6 | ||||
-rw-r--r-- | formats/format_gsm.c | 6 | ||||
-rw-r--r-- | formats/format_h263.c | 14 | ||||
-rw-r--r-- | formats/format_h264.c | 10 | ||||
-rw-r--r-- | formats/format_ilbc.c | 6 | ||||
-rw-r--r-- | formats/format_jpeg.c | 4 | ||||
-rw-r--r-- | formats/format_ogg_vorbis.c | 8 | ||||
-rw-r--r-- | formats/format_pcm.c | 6 | ||||
-rw-r--r-- | formats/format_siren14.c | 6 | ||||
-rw-r--r-- | formats/format_siren7.c | 6 | ||||
-rw-r--r-- | formats/format_sln.c | 6 | ||||
-rw-r--r-- | formats/format_sln16.c | 6 | ||||
-rw-r--r-- | formats/format_vox.c | 6 | ||||
-rw-r--r-- | formats/format_wav.c | 6 | ||||
-rw-r--r-- | formats/format_wav_gsm.c | 6 |
17 files changed, 57 insertions, 57 deletions
diff --git a/formats/format_g723.c b/formats/format_g723.c index 7b527da8c..c7d84c216 100644 --- a/formats/format_g723.c +++ b/formats/format_g723.c @@ -61,7 +61,7 @@ static struct ast_frame *g723_read(struct ast_filestream *s, int *whennext) } /* Read the data into the buffer */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_G723_1; + s->fr.subclass.codec = AST_FORMAT_G723_1; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, size); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != size) { @@ -82,7 +82,7 @@ static int g723_write(struct ast_filestream *s, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_G723_1) { + if (f->subclass.codec != AST_FORMAT_G723_1) { ast_log(LOG_WARNING, "Asked to write non-g723 frame!\n"); return -1; } diff --git a/formats/format_g726.c b/formats/format_g726.c index d54b52d2c..4394328fb 100644 --- a/formats/format_g726.c +++ b/formats/format_g726.c @@ -119,7 +119,7 @@ static struct ast_frame *g726_read(struct ast_filestream *s, int *whennext) /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_G726; + s->fr.subclass.codec = AST_FORMAT_G726; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, frame_size[fs->rate]); s->fr.samples = 8 * FRAME_TIME; @@ -141,9 +141,9 @@ static int g726_write(struct ast_filestream *s, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_G726) { - ast_log(LOG_WARNING, "Asked to write non-G726 frame (%d)!\n", - f->subclass); + if (f->subclass.codec != AST_FORMAT_G726) { + ast_log(LOG_WARNING, "Asked to write non-G726 frame (%s)!\n", + ast_getformatname(f->subclass.codec)); return -1; } if (f->datalen % frame_size[fs->rate]) { diff --git a/formats/format_g729.c b/formats/format_g729.c index cf7e20be7..6a676e1c0 100644 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -46,7 +46,7 @@ static struct ast_frame *g729_read(struct ast_filestream *s, int *whennext) int res; /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_G729A; + s->fr.subclass.codec = AST_FORMAT_G729A; s->fr.mallocd = 0; s->fr.samples = G729A_SAMPLES; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); @@ -66,8 +66,8 @@ static int g729_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_G729A) { - ast_log(LOG_WARNING, "Asked to write non-G729 frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_G729A) { + ast_log(LOG_WARNING, "Asked to write non-G729 frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if (f->datalen % 10) { diff --git a/formats/format_gsm.c b/formats/format_gsm.c index 480c63bd6..39526b4e8 100644 --- a/formats/format_gsm.c +++ b/formats/format_gsm.c @@ -53,7 +53,7 @@ static struct ast_frame *gsm_read(struct ast_filestream *s, int *whennext) int res; s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_GSM; + s->fr.subclass.codec = AST_FORMAT_GSM; AST_FRAME_SET_BUFFER(&(s->fr), s->buf, AST_FRIENDLY_OFFSET, GSM_FRAME_SIZE) s->fr.mallocd = 0; if ((res = fread(s->fr.data.ptr, 1, GSM_FRAME_SIZE, s->f)) != GSM_FRAME_SIZE) { @@ -74,8 +74,8 @@ static int gsm_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_GSM) { - ast_log(LOG_WARNING, "Asked to write non-GSM frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_GSM) { + ast_log(LOG_WARNING, "Asked to write non-GSM frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if (!(f->datalen % 65)) { diff --git a/formats/format_h263.c b/formats/format_h263.c index 9b6ac6764..13377f4ed 100644 --- a/formats/format_h263.c +++ b/formats/format_h263.c @@ -64,7 +64,7 @@ static int h263_open(struct ast_filestream *s) static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext) { int res; - int mark; + format_t mark; unsigned short len; unsigned int ts; struct h263_desc *fs = (struct h263_desc *)s->_private; @@ -80,7 +80,7 @@ static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext) return NULL; } s->fr.frametype = AST_FRAME_VIDEO; - s->fr.subclass = AST_FORMAT_H263; + s->fr.subclass.codec = AST_FORMAT_H263; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, len); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { @@ -90,7 +90,7 @@ static struct ast_frame *h263_read(struct ast_filestream *s, int *whennext) } s->fr.samples = fs->lastts; /* XXX what ? */ s->fr.datalen = len; - s->fr.subclass |= mark; + s->fr.subclass.codec |= mark; s->fr.delivery.tv_sec = 0; s->fr.delivery.tv_usec = 0; if ((res = fread(&ts, 1, sizeof(ts), s->f)) == sizeof(ts)) { @@ -106,18 +106,18 @@ static int h263_write(struct ast_filestream *fs, struct ast_frame *f) int res; unsigned int ts; unsigned short len; - int subclass; - int mark=0; + format_t subclass; + format_t mark=0; if (f->frametype != AST_FRAME_VIDEO) { ast_log(LOG_WARNING, "Asked to write non-video frame!\n"); return -1; } - subclass = f->subclass; + subclass = f->subclass.codec; if (subclass & 0x1) mark=0x8000; subclass &= ~0x1; if (subclass != AST_FORMAT_H263) { - ast_log(LOG_WARNING, "Asked to write non-h263 frame (%d)!\n", f->subclass); + ast_log(LOG_WARNING, "Asked to write non-h263 frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } ts = htonl(f->samples); diff --git a/formats/format_h264.c b/formats/format_h264.c index fa938a8c6..1fbad01ba 100644 --- a/formats/format_h264.c +++ b/formats/format_h264.c @@ -72,7 +72,7 @@ static struct ast_frame *h264_read(struct ast_filestream *s, int *whennext) len = BUF_SIZE; /* XXX truncate */ } s->fr.frametype = AST_FRAME_VIDEO; - s->fr.subclass = AST_FORMAT_H264; + s->fr.subclass.codec = AST_FORMAT_H264; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, len); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { @@ -82,7 +82,7 @@ static struct ast_frame *h264_read(struct ast_filestream *s, int *whennext) } s->fr.samples = fs->lastts; s->fr.datalen = len; - s->fr.subclass |= mark; + s->fr.subclass.codec |= mark; s->fr.delivery.tv_sec = 0; s->fr.delivery.tv_usec = 0; if ((res = fread(&ts, 1, sizeof(ts), s->f)) == sizeof(ts)) { @@ -104,9 +104,9 @@ static int h264_write(struct ast_filestream *s, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-video frame!\n"); return -1; } - mark = (f->subclass & 0x1) ? 0x8000 : 0; - if ((f->subclass & ~0x1) != AST_FORMAT_H264) { - ast_log(LOG_WARNING, "Asked to write non-h264 frame (%d)!\n", f->subclass); + mark = (f->subclass.codec & 0x1) ? 0x8000 : 0; + if ((f->subclass.codec & ~0x1) != AST_FORMAT_H264) { + ast_log(LOG_WARNING, "Asked to write non-h264 frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } ts = htonl(f->samples); diff --git a/formats/format_ilbc.c b/formats/format_ilbc.c index 439219305..6e34fb4cd 100644 --- a/formats/format_ilbc.c +++ b/formats/format_ilbc.c @@ -45,7 +45,7 @@ static struct ast_frame *ilbc_read(struct ast_filestream *s, int *whennext) int res; /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_ILBC; + s->fr.subclass.codec = AST_FORMAT_ILBC; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, ILBC_BUF_SIZE); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { @@ -64,8 +64,8 @@ static int ilbc_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_ILBC) { - ast_log(LOG_WARNING, "Asked to write non-iLBC frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_ILBC) { + ast_log(LOG_WARNING, "Asked to write non-iLBC frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if (f->datalen % 50) { diff --git a/formats/format_jpeg.c b/formats/format_jpeg.c index 92117fce1..98b98c268 100644 --- a/formats/format_jpeg.c +++ b/formats/format_jpeg.c @@ -48,7 +48,7 @@ static struct ast_frame *jpeg_read_image(int fd, int len) } memset(&fr, 0, sizeof(fr)); fr.frametype = AST_FRAME_IMAGE; - fr.subclass = AST_FORMAT_JPEG; + fr.subclass.codec = AST_FORMAT_JPEG; fr.data.ptr = buf; fr.src = "JPEG Read"; fr.datalen = len; @@ -74,7 +74,7 @@ static int jpeg_write_image(int fd, struct ast_frame *fr) ast_log(LOG_WARNING, "Not an image\n"); return -1; } - if (fr->subclass != AST_FORMAT_JPEG) { + if (fr->subclass.codec != AST_FORMAT_JPEG) { ast_log(LOG_WARNING, "Not a jpeg image\n"); return -1; } diff --git a/formats/format_ogg_vorbis.c b/formats/format_ogg_vorbis.c index e3b81eff1..29d5ad50f 100644 --- a/formats/format_ogg_vorbis.c +++ b/formats/format_ogg_vorbis.c @@ -291,9 +291,9 @@ static int ogg_vorbis_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_SLINEAR) { - ast_log(LOG_WARNING, "Asked to write non-SLINEAR frame (%d)!\n", - f->subclass); + if (f->subclass.codec != AST_FORMAT_SLINEAR) { + ast_log(LOG_WARNING, "Asked to write non-SLINEAR frame (%s)!\n", + ast_getformatname(f->subclass.codec)); return -1; } if (!f->datalen) @@ -438,7 +438,7 @@ static struct ast_frame *ogg_vorbis_read(struct ast_filestream *fs, short *buf; /* SLIN data buffer */ fs->fr.frametype = AST_FRAME_VOICE; - fs->fr.subclass = AST_FORMAT_SLINEAR; + fs->fr.subclass.codec = AST_FORMAT_SLINEAR; fs->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&fs->fr, fs->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); buf = (short *)(fs->fr.data.ptr); /* SLIN data buffer */ diff --git a/formats/format_pcm.c b/formats/format_pcm.c index 1a5637f3a..b8517af6e 100644 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -80,7 +80,7 @@ static struct ast_frame *pcm_read(struct ast_filestream *s, int *whennext) /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = s->fmt->format; + s->fr.subclass.codec = s->fmt->format; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) < 1) { @@ -163,8 +163,8 @@ static int pcm_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != fs->fmt->format) { - ast_log(LOG_WARNING, "Asked to write incompatible format frame (%d)!\n", f->subclass); + if (f->subclass.codec != fs->fmt->format) { + ast_log(LOG_WARNING, "Asked to write incompatible format frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } diff --git a/formats/format_siren14.c b/formats/format_siren14.c index 0ac0174cf..8fdd4aa1f 100644 --- a/formats/format_siren14.c +++ b/formats/format_siren14.c @@ -41,7 +41,7 @@ static struct ast_frame *siren14read(struct ast_filestream *s, int *whennext) /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_SIREN14; + s->fr.subclass.codec = AST_FORMAT_SIREN14; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { @@ -61,8 +61,8 @@ static int siren14write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_SIREN14) { - ast_log(LOG_WARNING, "Asked to write non-Siren14 frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_SIREN14) { + ast_log(LOG_WARNING, "Asked to write non-Siren14 frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if ((res = fwrite(f->data.ptr, 1, f->datalen, fs->f)) != f->datalen) { diff --git a/formats/format_siren7.c b/formats/format_siren7.c index 0b61a72b2..44d4da751 100644 --- a/formats/format_siren7.c +++ b/formats/format_siren7.c @@ -41,7 +41,7 @@ static struct ast_frame *siren7read(struct ast_filestream *s, int *whennext) /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_SIREN7; + s->fr.subclass.codec = AST_FORMAT_SIREN7; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) != s->fr.datalen) { @@ -61,8 +61,8 @@ static int siren7write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_SIREN7) { - ast_log(LOG_WARNING, "Asked to write non-Siren7 frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_SIREN7) { + ast_log(LOG_WARNING, "Asked to write non-Siren7 frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if ((res = fwrite(f->data.ptr, 1, f->datalen, fs->f)) != f->datalen) { diff --git a/formats/format_sln.c b/formats/format_sln.c index c78a4fdcb..9c4cce75b 100644 --- a/formats/format_sln.c +++ b/formats/format_sln.c @@ -39,7 +39,7 @@ static struct ast_frame *slinear_read(struct ast_filestream *s, int *whennext) /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_SLINEAR; + s->fr.subclass.codec = AST_FORMAT_SLINEAR; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) < 1) { @@ -59,8 +59,8 @@ static int slinear_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_SLINEAR) { - ast_log(LOG_WARNING, "Asked to write non-slinear frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_SLINEAR) { + ast_log(LOG_WARNING, "Asked to write non-slinear frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if ((res = fwrite(f->data.ptr, 1, f->datalen, fs->f)) != f->datalen) { diff --git a/formats/format_sln16.c b/formats/format_sln16.c index 78260f337..15991f854 100644 --- a/formats/format_sln16.c +++ b/formats/format_sln16.c @@ -40,7 +40,7 @@ static struct ast_frame *slinear_read(struct ast_filestream *s, int *whennext) /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_SLINEAR16; + s->fr.subclass.codec = AST_FORMAT_SLINEAR16; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) < 1) { @@ -61,8 +61,8 @@ static int slinear_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_SLINEAR16) { - ast_log(LOG_WARNING, "Asked to write non-slinear16 frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_SLINEAR16) { + ast_log(LOG_WARNING, "Asked to write non-slinear16 frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if ((res = fwrite(f->data.ptr, 1, f->datalen, fs->f)) != f->datalen) { diff --git a/formats/format_vox.c b/formats/format_vox.c index a9aef6070..546777752 100644 --- a/formats/format_vox.c +++ b/formats/format_vox.c @@ -41,7 +41,7 @@ static struct ast_frame *vox_read(struct ast_filestream *s, int *whennext) /* Send a frame from the file to the appropriate channel */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_ADPCM; + s->fr.subclass.codec = AST_FORMAT_ADPCM; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, BUF_SIZE); if ((res = fread(s->fr.data.ptr, 1, s->fr.datalen, s->f)) < 1) { @@ -61,8 +61,8 @@ static int vox_write(struct ast_filestream *s, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_ADPCM) { - ast_log(LOG_WARNING, "Asked to write non-ADPCM frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_ADPCM) { + ast_log(LOG_WARNING, "Asked to write non-ADPCM frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if ((res = fwrite(f->data.ptr, 1, f->datalen, s->f)) != f->datalen) { diff --git a/formats/format_wav.c b/formats/format_wav.c index b458442e2..ab02a5d15 100644 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -361,7 +361,7 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext) bytes = 0; /* ast_debug(1, "here: %d, maxlen: %d, bytes: %d\n", here, s->maxlen, bytes); */ s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_SLINEAR; + s->fr.subclass.codec = AST_FORMAT_SLINEAR; s->fr.mallocd = 0; AST_FRAME_SET_BUFFER(&s->fr, s->buf, AST_FRIENDLY_OFFSET, bytes); @@ -397,8 +397,8 @@ static int wav_write(struct ast_filestream *fs, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_SLINEAR) { - ast_log(LOG_WARNING, "Asked to write non-SLINEAR frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_SLINEAR) { + ast_log(LOG_WARNING, "Asked to write non-SLINEAR frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } if (!f->datalen) diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index aa3dd2eee..5796e28a6 100644 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -395,7 +395,7 @@ static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext) struct wavg_desc *fs = (struct wavg_desc *)s->_private; s->fr.frametype = AST_FRAME_VOICE; - s->fr.subclass = AST_FORMAT_GSM; + s->fr.subclass.codec = AST_FORMAT_GSM; s->fr.offset = AST_FRIENDLY_OFFSET; s->fr.samples = GSM_SAMPLES; s->fr.mallocd = 0; @@ -432,8 +432,8 @@ static int wav_write(struct ast_filestream *s, struct ast_frame *f) ast_log(LOG_WARNING, "Asked to write non-voice frame!\n"); return -1; } - if (f->subclass != AST_FORMAT_GSM) { - ast_log(LOG_WARNING, "Asked to write non-GSM frame (%d)!\n", f->subclass); + if (f->subclass.codec != AST_FORMAT_GSM) { + ast_log(LOG_WARNING, "Asked to write non-GSM frame (%s)!\n", ast_getformatname(f->subclass.codec)); return -1; } /* XXX this might fail... if the input is a multiple of MSGSM_FRAME_SIZE |