diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-07-31 19:40:06 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-07-31 19:40:06 +0000 |
commit | 39a127bfbca8adf8c74ca4e5738bbf9f05cdf4da (patch) | |
tree | 64a69e7c37ceca47f061175637e7d2670682666a /libavformat/aviobuf.c | |
parent | d701934bef6ff6868c0a2179b7b9105c7a49b41f (diff) | |
download | ffmpeg-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/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 9 |
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; |