changeset 3614:71fdc3f7c771 libavformat

Only reset buffer state if seeking is successful; update seek reg ref.
author bcoudurier
date Thu, 31 Jul 2008 19:40:06 +0000
parents e961e9aa3767
children f3db1276dc02
files aviobuf.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/aviobuf.c	Thu Jul 31 18:12:37 2008 +0000
+++ b/aviobuf.c	Thu Jul 31 19:40:06 2008 +0000
@@ -163,14 +163,13 @@
         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;
         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;