]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix wav fomat (bug #3837)
authorRussell Bryant <russell@russellbryant.com>
Fri, 1 Apr 2005 03:23:33 +0000 (03:23 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 1 Apr 2005 03:23:33 +0000 (03:23 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5329 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
formats/format_wav_gsm.c

diff --git a/CHANGES b/CHANGES
index 834ebdd31bdede719a2eb6a82a11d269bacf1534..60cbe74cd37a3554da40153d4cf862cb0e45dd99 100755 (executable)
--- a/CHANGES
+++ b/CHANGES
  -- res_agi
     -- A fix has been added to prevent calls from being hung up when more than one
        call is executing an AGI script calling the GET DATA command.
- -- asterisk.spec
-    -- A line was missing for the autosupport script that caused "make rpm" to fail
  -- general
     -- A problem has been fixed with saying the date in Spanish.
+    -- A line was missing for the autosupport script that caused "make rpm" to fail
+    -- Fixed a problem with wav formatting that prevented files from being played
+       in some media players
 
 Asterisk 1.0.7
 
index 5b4d31f6a5658844e0642650537e415198130308..ad3e24fc850813d8155e054c18833595b718bccc 100755 (executable)
@@ -51,7 +51,6 @@ struct ast_filestream {
           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 @@ static void wav_close(struct ast_filestream *s)
        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 @@ static int wav_write(struct ast_filestream *fs, struct ast_frame *f)
                                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 @@ static int wav_write(struct ast_filestream *fs, struct ast_frame *f)
                                        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 */