[Asterisk-cvs] asterisk/formats format_wav_gsm.c,1.29,1.30

markster at lists.digium.com markster at lists.digium.com
Tue Mar 22 22:36:00 CST 2005


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

Modified Files:
	format_wav_gsm.c 
Log Message:
Fix wav format (bug #3837)


Index: format_wav_gsm.c
===================================================================
RCS file: /usr/cvsroot/asterisk/formats/format_wav_gsm.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- format_wav_gsm.c	21 Jan 2005 07:06:25 -0000	1.29
+++ format_wav_gsm.c	23 Mar 2005 04:30:31 -0000	1.30
@@ -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 */




More information about the svn-commits mailing list