diff options
Diffstat (limited to 'formats/format_wav.c')
-rw-r--r-- | formats/format_wav.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/formats/format_wav.c b/formats/format_wav.c index cead61c5b..9e92e6a35 100644 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -23,7 +23,7 @@ * \arg File name extension: wav (lower case) * \ingroup formats */ - + /*** MODULEINFO <support_level>core</support_level> ***/ @@ -168,9 +168,9 @@ static int check_header(FILE *f, int hz) } /* Skip any facts and get the first data block */ for(;;) - { + { char buf[4]; - + /* Begin data chunk */ if (fread(&buf, 1, 4, f) != 4) { ast_log(LOG_WARNING, "Read failed (block header format)\n"); @@ -189,7 +189,7 @@ static int check_header(FILE *f, int hz) return -1; continue; } - if(memcmp(buf, "data", 4) == 0 ) + if(memcmp(buf, "data", 4) == 0 ) break; ast_log(LOG_DEBUG, "Skipping unknown block '%.4s'\n", buf); if (fseek(f,data,SEEK_CUR) == -1 ) { @@ -202,7 +202,7 @@ static int check_header(FILE *f, int hz) truelength = lseek(fd, 0, SEEK_END); lseek(fd, curpos, SEEK_SET); truelength -= curpos; -#endif +#endif return data; } @@ -210,7 +210,7 @@ static int update_header(FILE *f) { off_t cur,end; int datalen,filelen,bytes; - + cur = ftello(f); fseek(f, 0, SEEK_END); end = ftello(f); @@ -219,7 +219,7 @@ static int update_header(FILE *f) datalen = htoll(bytes); /* chunk size is bytes of data plus 36 bytes of header */ filelen = htoll(36 + bytes); - + if (cur < 0) { ast_log(LOG_WARNING, "Unable to find our position\n"); return -1; @@ -434,7 +434,7 @@ static int wav_write(struct ast_filestream *fs, struct ast_frame *f) return -1; } tmpi = f->data.ptr; - for (x=0; x < f->datalen/2; x++) + for (x=0; x < f->datalen/2; x++) tmp[x] = (tmpi[x] << 8) | ((tmpi[x] & 0xff00) >> 8); if ((res = fwrite(tmp, 1, f->datalen, fs->f)) != f->datalen ) { @@ -447,7 +447,7 @@ static int wav_write(struct ast_filestream *fs, struct ast_frame *f) } s->bytes += f->datalen; - + return 0; } |