aboutsummaryrefslogtreecommitdiffstats
path: root/formats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-18 22:04:07 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-18 22:04:07 +0000
commit253322596d3e9cb116d4957c5500dd6143235d6e (patch)
tree0e2bf6344b172b40a0e38e1ea56edd9101d1649d /formats
parent0962821aa7ccaaa8b9b500a152ec8d0ea0b8ef65 (diff)
Fix comment issues (bug #3089)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4479 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats')
-rwxr-xr-xformats/format_pcm.c2
-rwxr-xr-xformats/format_pcm_alaw.c21
-rwxr-xr-xformats/format_wav.c6
3 files changed, 15 insertions, 14 deletions
diff --git a/formats/format_pcm.c b/formats/format_pcm.c
index 6d0127177..14edd0bb6 100755
--- a/formats/format_pcm.c
+++ b/formats/format_pcm.c
@@ -177,7 +177,7 @@ static int pcm_seek(struct ast_filestream *fs, long sample_offset, int whence)
if (whence != SEEK_FORCECUR) {
offset = (offset > max)?max:offset;
}
- // always protect against seeking past begining.
+ /* always protect against seeking past begining. */
offset = (offset < min)?min:offset;
return lseek(fs->fd, offset, SEEK_SET);
}
diff --git a/formats/format_pcm_alaw.c b/formats/format_pcm_alaw.c
index 866cd2360..b677bb6fe 100755
--- a/formats/format_pcm_alaw.c
+++ b/formats/format_pcm_alaw.c
@@ -3,9 +3,9 @@
*
* Flat, binary, alaw PCM file format.
*
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999, Digium, inc
*
- * Mark Spencer <markster@linux-support.net>
+ * Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -39,7 +39,7 @@
#define BUF_SIZE 160 /* 160 samples */
-// #define REALTIME_WRITE
+/* #define REALTIME_WRITE */
struct ast_filestream {
void *reserved[AST_RESERVED_POINTERS];
@@ -192,18 +192,19 @@ static int pcm_write(struct ast_filestream *fs, struct ast_frame *f)
#ifdef REALTIME_WRITE
cur_time = get_time();
- fpos = ( cur_time - fs->start_time ) * 8; // 8 bytes per msec
- // Check if we have written to this position yet. If we have, then increment pos by one frame
- // for some degree of protection against receiving packets in the same clock tick.
+ fpos = ( cur_time - fs->start_time ) * 8; /* 8 bytes per msec */
+ /* Check if we have written to this position yet. If we have, then increment pos by one frame
+ * for some degree of protection against receiving packets in the same clock tick.
+ */
fstat( fs->fd, &stat_buf );
if( stat_buf.st_size > fpos )
{
- fpos += f->datalen; // Incrementing with the size of this current frame
+ fpos += f->datalen; /* Incrementing with the size of this current frame */
}
if( stat_buf.st_size < fpos )
{
- // fill the gap with 0x55 rather than 0.
+ /* fill the gap with 0x55 rather than 0. */
char buf[ 512 ];
unsigned long cur, to_write;
@@ -232,7 +233,7 @@ static int pcm_write(struct ast_filestream *fs, struct ast_frame *f)
ast_log( LOG_WARNING, "Cannot seek in file: %s\n", strerror(errno) );
return -1;
}
-#endif // REALTIME_WRITE
+#endif /* REALTIME_WRITE */
if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
ast_log(LOG_WARNING, "Bad write (%d/%d): %s\n", res, f->datalen, strerror(errno));
@@ -257,7 +258,7 @@ static int pcm_seek(struct ast_filestream *fs, long sample_offset, int whence)
if (whence != SEEK_FORCECUR) {
offset = (offset > max)?max:offset;
}
- // Always protect against seeking past begining
+ /* Always protect against seeking past begining */
offset = (offset < min)?min:offset;
return lseek(fs->fd, offset, SEEK_SET);
}
diff --git a/formats/format_wav.c b/formats/format_wav.c
index be6053447..c0781f6f0 100755
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -177,12 +177,12 @@ static int check_header(int fd)
ast_log(LOG_WARNING, "Read failed (Bits Per Sample): %d\n", ltohs(bisam));
return -1;
}
- // Skip any additional header
+ /* Skip any additional header */
if ( lseek(fd,ltohl(hsize)-16,SEEK_CUR) == -1 ) {
ast_log(LOG_WARNING, "Failed to skip remaining header bytes: %d\n", ltohl(hsize)-16 );
return -1;
}
- // Skip any facts and get the first data block
+ /* Skip any facts and get the first data block */
for(;;)
{
char buf[4];
@@ -529,7 +529,7 @@ static int wav_seek(struct ast_filestream *fs, long sample_offset, int whence)
if (whence != SEEK_FORCECUR) {
offset = (offset > max)?max:offset;
}
- // always protect the header space.
+ /* always protect the header space. */
offset = (offset < min)?min:offset;
return lseek(fs->fd,offset,SEEK_SET);
}