summaryrefslogtreecommitdiff
path: root/formats/format_sln.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2006-02-20 23:35:12 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2006-02-20 23:35:12 +0000
commitaa20c556f75ec1556e58259ff2168a26bc574b31 (patch)
tree867b95de4af325e2b9e52f635b10137ffde176ba /formats/format_sln.c
parent67e55d4d67cde1495dfa2c3f8cad7ba61ed6bf50 (diff)
Bug 5984 - Convert file offsets to 64 bit
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'formats/format_sln.c')
-rw-r--r--formats/format_sln.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/formats/format_sln.c b/formats/format_sln.c
index d155b09a2..74792c605 100644
--- a/formats/format_sln.c
+++ b/formats/format_sln.c
@@ -169,15 +169,15 @@ static int slinear_write(struct ast_filestream *fs, struct ast_frame *f)
return 0;
}
-static int slinear_seek(struct ast_filestream *fs, long sample_offset, int whence)
+static int slinear_seek(struct ast_filestream *fs, off_t sample_offset, int whence)
{
off_t offset=0,min,cur,max;
min = 0;
sample_offset <<= 1;
- 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);
if (whence == SEEK_SET)
offset = sample_offset;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
@@ -189,18 +189,18 @@ static int slinear_seek(struct ast_filestream *fs, long sample_offset, int whenc
}
/* always protect against seeking past begining. */
offset = (offset < min)?min:offset;
- return fseek(fs->f, offset, SEEK_SET);
+ return fseeko(fs->f, offset, SEEK_SET);
}
static int slinear_trunc(struct ast_filestream *fs)
{
- return ftruncate(fileno(fs->f), ftell(fs->f));
+ return ftruncate(fileno(fs->f), ftello(fs->f));
}
-static long slinear_tell(struct ast_filestream *fs)
+static off_t slinear_tell(struct ast_filestream *fs)
{
off_t offset;
- offset = ftell(fs->f);
+ offset = ftello(fs->f);
return offset / 2;
}