aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-07-31 19:40:06 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-07-31 19:40:06 +0000
commit39a127bfbca8adf8c74ca4e5738bbf9f05cdf4da (patch)
tree64a69e7c37ceca47f061175637e7d2670682666a /libavformat
parentd701934bef6ff6868c0a2179b7b9105c7a49b41f (diff)
downloadffmpeg-39a127bfbca8adf8c74ca4e5738bbf9f05cdf4da.tar.gz
Only reset buffer state if seeking is successful; update seek reg ref.
Originally committed as revision 14491 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/aviobuf.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 6206c66909..34029a5ee7 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -163,14 +163,13 @@ offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)
if (s->write_flag) {
flush_buffer(s);
s->must_flush = 1;
- } else
-#endif /* defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK) */
- {
- s->buf_end = s->buffer;
}
- s->buf_ptr = s->buffer;
+#endif /* defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK) */
if (!s->seek || (res = s->seek(s->opaque, offset, SEEK_SET)) < 0)
return res;
+ if (!s->write_flag)
+ s->buf_end = s->buffer;
+ s->buf_ptr = s->buffer;
s->pos = offset;
}
s->eof_reached = 0;