--- format_wav_gsm.c.orig Thu Feb 3 18:39:26 2005 +++ format_wav_gsm.c Tue Mar 22 19:29:38 2005 @@ -55,7 +55,6 @@ weird MS format */ /* This is what a filestream means to us */ int fd; /* Descriptor */ - int bytes; struct ast_frame fr; /* Frame information */ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */ char empty; /* Empty character */ @@ -402,7 +401,7 @@ ast_mutex_unlock(&wav_lock); ast_update_use_count(); /* Pad to even length */ - if (s->bytes & 0x1) + if (lseek(s->fd, 0, SEEK_END) & 0x1) write(s->fd, &zero, 1); close(s->fd); free(s); @@ -462,7 +461,6 @@ ast_log(LOG_WARNING, "Bad write (%d/65): %s\n", res, strerror(errno)); return -1; } - fs->bytes += 65; update_header(fs->fd); len += 65; } else { @@ -473,7 +471,6 @@ ast_log(LOG_WARNING, "Bad write (%d/65): %s\n", res, strerror(errno)); return -1; } - fs->bytes += 65; update_header(fs->fd); } else { /* Copy the data and do nothing */