From aa20c556f75ec1556e58259ff2168a26bc574b31 Mon Sep 17 00:00:00 2001 From: Tilghman Lesher Date: Mon, 20 Feb 2006 23:35:12 +0000 Subject: Bug 5984 - Convert file offsets to 64 bit git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10579 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- formats/format_gsm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'formats/format_gsm.c') diff --git a/formats/format_gsm.c b/formats/format_gsm.c index 176c73a97..c6ef31f7e 100644 --- a/formats/format_gsm.c +++ b/formats/format_gsm.c @@ -195,14 +195,14 @@ static int gsm_write(struct ast_filestream *fs, struct ast_frame *f) return 0; } -static int gsm_seek(struct ast_filestream *fs, long sample_offset, int whence) +static int gsm_seek(struct ast_filestream *fs, off_t sample_offset, int whence) { off_t offset=0,min,cur,max,distance; 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); /* have to fudge to frame here, so not fully to sample */ distance = (sample_offset/160) * 33; if(whence == SEEK_SET) @@ -217,23 +217,23 @@ static int gsm_seek(struct ast_filestream *fs, long sample_offset, int whence) offset = (offset > max)?max:offset; } else if (offset > max) { int i; - fseek(fs->f, 0, SEEK_END); + fseeko(fs->f, 0, SEEK_END); for (i=0; i< (offset - max) / 33; i++) { fwrite(gsm_silence, 1, 33, fs->f); } } - return fseek(fs->f, offset, SEEK_SET); + return fseeko(fs->f, offset, SEEK_SET); } static int gsm_trunc(struct ast_filestream *fs) { - return ftruncate(fileno(fs->f), ftell(fs->f)); + return ftruncate(fileno(fs->f), ftello(fs->f)); } -static long gsm_tell(struct ast_filestream *fs) +static off_t gsm_tell(struct ast_filestream *fs) { off_t offset; - offset = ftell(fs->f); + offset = ftello(fs->f); return (offset/33)*160; } -- cgit v1.2.3