diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-28 16:20:59 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-03-28 16:20:59 +0000 |
commit | 1b359aad73a5cb02730616692b5ab2715bdf3ad8 (patch) | |
tree | 7bb857cb18e75b0e38823cc529566dd6fd0f101a /formats/format_wav_gsm.c | |
parent | 5dc9edd7f5d090f494b42a2c5150e2aa5c34978f (diff) |
Merged revisions 111658 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r111658 | qwell | 2008-03-28 11:19:56 -0500 (Fri, 28 Mar 2008) | 8 lines
The file size of WAV49 does not need to be an even number.
(closes issue #12128)
Reported by: mdu113
Patches:
12128-noevenlength.diff uploaded by qwell (license 4)
Tested by: qwell, mdu113
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111659 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats/format_wav_gsm.c')
-rw-r--r-- | formats/format_wav_gsm.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/formats/format_wav_gsm.c b/formats/format_wav_gsm.c index cf40560de..aa576195c 100644 --- a/formats/format_wav_gsm.c +++ b/formats/format_wav_gsm.c @@ -214,8 +214,8 @@ static int update_header(FILE *f) /* in a gsm WAV, data starts 60 bytes in */ bytes = end - MSGSM_DATA_OFFSET; samples = htoll(bytes / MSGSM_FRAME_SIZE * MSGSM_SAMPLES); - datalen = htoll((bytes + 1) & ~0x1); - filelen = htoll(MSGSM_DATA_OFFSET - 8 + ((bytes + 1) & ~0x1)); + datalen = htoll(bytes); + filelen = htoll(MSGSM_DATA_OFFSET - 8 + bytes); if (cur < 0) { ast_log(LOG_WARNING, "Unable to find our position\n"); return -1; @@ -389,15 +389,6 @@ static int wav_rewrite(struct ast_filestream *s, const char *comment) return 0; } -static void wav_close(struct ast_filestream *s) -{ - char zero = 0; - /* Pad to even length */ - fseek(s->f, 0, SEEK_END); - if (ftello(s->f) & 0x1) - fwrite(&zero, 1, 1, s->f); -} - static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext) { /* Send a frame from the file to the appropriate channel */ @@ -539,7 +530,6 @@ static const struct ast_format wav49_f = { .trunc = wav_trunc, .tell = wav_tell, .read = wav_read, - .close = wav_close, .buf_size = 2*GSM_FRAME_SIZE + AST_FRIENDLY_OFFSET, .desc_size = sizeof(struct wavg_desc), }; |