aboutsummaryrefslogtreecommitdiffstats
path: root/formats/format_sln.c
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-19 18:03:48 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-19 18:03:48 +0000
commitdcbc1ea48de8e8c768682c66f96c137b6a3b4b65 (patch)
treeca1d4b50129b3f663cf817dbde3417d663a1685b /formats/format_sln.c
parent0edd5e59c8fb1efce707d33fd85fb83aedac7c75 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@10486 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'formats/format_sln.c')
-rw-r--r--formats/format_sln.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/formats/format_sln.c b/formats/format_sln.c
index 008a715bc..c1a16618d 100644
--- a/formats/format_sln.c
+++ b/formats/format_sln.c
@@ -172,6 +172,7 @@ static int slinear_write(struct ast_filestream *fs, struct ast_frame *f)
static int slinear_seek(struct ast_filestream *fs, long sample_offset, int whence)
{
off_t offset=0,min,cur,max;
+ int res;
min = 0;
sample_offset <<= 1;
@@ -189,7 +190,12 @@ 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) / 2;
+ res = fseek(fs->f, offset, SEEK_SET);
+ /* Negative values indicate error */
+ if (res > -1)
+ return res / 2;
+ else
+ return res;
}
static int slinear_trunc(struct ast_filestream *fs)