Update of /usr/cvsroot/asterisk/formats
In directory mongoose.digium.com:/tmp/cvs-serv27838/formats

Modified Files:
      Tag: v1-0
        format_wav_gsm.c 
Log Message:
fix wav fomat (bug #3837)


Index: format_wav_gsm.c
===================================================================
RCS file: /usr/cvsroot/asterisk/formats/format_wav_gsm.c,v
retrieving revision 1.23.2.1
retrieving revision 1.23.2.2
diff -u -d -r1.23.2.1 -r1.23.2.2
--- format_wav_gsm.c    9 Oct 2004 16:32:21 -0000       1.23.2.1
+++ format_wav_gsm.c    1 Apr 2005 03:23:33 -0000       1.23.2.2
@@ -51,7 +51,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 */
@@ -398,7 +397,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);
@@ -458,7 +457,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 {
@@ -469,7 +467,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 */

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to