aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoward Chu <hyc@highlandsun.com>2010-04-12 15:03:30 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-04-12 15:03:30 +0000
commitc007c687c9af874d62221106bd98e44d1b8f1b29 (patch)
treed5676b719e1e8d034b8eb6110d3c9a619b04bc3a
parentf01210a6911557afd2a95c4acf1917b34e5bead6 (diff)
downloadffmpeg-c007c687c9af874d62221106bd98e44d1b8f1b29.tar.gz
Do not set pos to an error value.
Patch by Howard Chu, hyc highlandsun com Originally committed as revision 22853 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/aviobuf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 0bc874bc44..421a64a338 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -743,8 +743,13 @@ int64_t av_url_read_fseek(ByteIOContext *s, int stream_index,
return AVERROR(ENOSYS);
ret = s->read_seek(h, stream_index, timestamp, flags);
if(ret >= 0) {
+ int64_t pos;
s->buf_ptr = s->buf_end; // Flush buffer
- s->pos = s->seek(h, 0, SEEK_CUR);
+ pos = s->seek(h, 0, SEEK_CUR);
+ if (pos >= 0)
+ s->pos = pos;
+ else if (pos != AVERROR(ENOSYS))
+ ret = pos;
}
return ret;
}