diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-20 23:35:12 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-02-20 23:35:12 +0000 |
commit | e8504c1dcecfd65acce1e93c3f3959e0b47fd11d (patch) | |
tree | 867b95de4af325e2b9e52f635b10137ffde176ba /formats/format_pcm.c | |
parent | e100a316d4ea686cc45a1d549a2e396579712e43 (diff) |
Bug 5984 - Convert file offsets to 64 bit
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10579 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats/format_pcm.c')
-rw-r--r-- | formats/format_pcm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/formats/format_pcm.c b/formats/format_pcm.c index da72a559e..240be65d1 100644 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -174,14 +174,14 @@ static int pcm_write(struct ast_filestream *fs, struct ast_frame *f) return 0; } -static int pcm_seek(struct ast_filestream *fs, long sample_offset, int whence) +static int pcm_seek(struct ast_filestream *fs, off_t sample_offset, int whence) { - long cur, max, offset = 0; + off_t cur, max, offset = 0; int ret = -1; /* assume error */ - cur = ftell(fs->f); - fseek(fs->f, 0, SEEK_END); - max = ftell(fs->f); + cur = ftello(fs->f); + fseeko(fs->f, 0, SEEK_END); + max = ftello(fs->f); switch (whence) { case SEEK_SET: @@ -218,20 +218,20 @@ static int pcm_seek(struct ast_filestream *fs, long sample_offset, int whence) ast_log(LOG_WARNING, "offset too large %ld, truncating to %ld\n", offset, max); offset = max; } - ret = fseek(fs->f, offset, SEEK_SET); + ret = fseeko(fs->f, offset, SEEK_SET); } return ret; } static int pcm_trunc(struct ast_filestream *fs) { - return ftruncate(fileno(fs->f), ftell(fs->f)); + return ftruncate(fileno(fs->f), ftello(fs->f)); } -static long pcm_tell(struct ast_filestream *fs) +static off_t pcm_tell(struct ast_filestream *fs) { off_t offset; - offset = ftell(fs->f); + offset = ftello(fs->f); return offset; } |