From e8504c1dcecfd65acce1e93c3f3959e0b47fd11d Mon Sep 17 00:00:00 2001 From: tilghman Date: Mon, 20 Feb 2006 23:35:12 +0000 Subject: Bug 5984 - Convert file offsets to 64 bit git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10579 f38db490-d61c-443f-a65b-d21fe96a405b --- formats/format_g729.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'formats/format_g729.c') diff --git a/formats/format_g729.c b/formats/format_g729.c index 6afe539da..5194cea05 100644 --- a/formats/format_g729.c +++ b/formats/format_g729.c @@ -181,14 +181,14 @@ static char *g729_getcomment(struct ast_filestream *s) return NULL; } -static int g729_seek(struct ast_filestream *fs, long sample_offset, int whence) +static int g729_seek(struct ast_filestream *fs, off_t sample_offset, int whence) { long bytes; off_t min,cur,max,offset=0; min = 0; - 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); bytes = 20 * (sample_offset / 160); if (whence == SEEK_SET) @@ -202,7 +202,7 @@ static int g729_seek(struct ast_filestream *fs, long sample_offset, int whence) } /* protect against seeking beyond begining. */ offset = (offset < min)?min:offset; - if (fseek(fs->f, offset, SEEK_SET) < 0) + if (fseeko(fs->f, offset, SEEK_SET) < 0) return -1; return 0; } @@ -210,15 +210,15 @@ static int g729_seek(struct ast_filestream *fs, long sample_offset, int whence) static int g729_trunc(struct ast_filestream *fs) { /* Truncate file to current length */ - if (ftruncate(fileno(fs->f), ftell(fs->f)) < 0) + if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0) return -1; return 0; } -static long g729_tell(struct ast_filestream *fs) +static off_t g729_tell(struct ast_filestream *fs) { off_t offset; - offset = ftell(fs->f); + offset = ftello(fs->f); return (offset/20)*160; } -- cgit v1.2.3