summaryrefslogtreecommitdiff
path: root/formats/format_sln.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2006-02-19 17:17:28 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2006-02-19 17:17:28 +0000
commit5ef84a55a049b77cbd2bdcb7a20dc083d0b235a3 (patch)
tree238c509b594d3fa50e65f8f8864f6dc10de3b5a9 /formats/format_sln.c
parentd4480e9c590e1e4f174d1386a2cced7f1141e481 (diff)
Merged revisions 10462 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r10462 | tilghman | 2006-02-19 11:11:02 -0600 (Sun, 19 Feb 2006) | 2 lines Bug 6539 - Division by two negates error flag ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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)