summaryrefslogtreecommitdiff
path: root/formats/format_ilbc.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_ilbc.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_ilbc.c')
-rw-r--r--formats/format_ilbc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/formats/format_ilbc.c b/formats/format_ilbc.c
index cbe017f66..f0bcfbf4e 100644
--- a/formats/format_ilbc.c
+++ b/formats/format_ilbc.c
@@ -180,14 +180,14 @@ static char *ilbc_getcomment(struct ast_filestream *s)
return NULL;
}
-static int ilbc_seek(struct ast_filestream *fs, long sample_offset, int whence)
+static int ilbc_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 = 50 * (sample_offset / 240);
if (whence == SEEK_SET)
@@ -201,7 +201,7 @@ static int ilbc_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;
}
@@ -209,15 +209,15 @@ static int ilbc_seek(struct ast_filestream *fs, long sample_offset, int whence)
static int ilbc_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 ilbc_tell(struct ast_filestream *fs)
+static off_t ilbc_tell(struct ast_filestream *fs)
{
off_t offset;
- offset = ftell(fs->f);
+ offset = ftello(fs->f);
return (offset/50)*240;
}