changeset 1325:9e739042d95c libavformat

simplify seek() failure check
author michael
date Tue, 26 Sep 2006 16:09:56 +0000
parents 024cf76ac4d1
children 142fb755fbf5
files aviobuf.c
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/aviobuf.c	Tue Sep 26 03:41:51 2006 +0000
+++ b/aviobuf.c	Tue Sep 26 16:09:56 2006 +0000
@@ -123,9 +123,6 @@
         /* can do the seek inside the buffer */
         s->buf_ptr = s->buffer + offset1;
     } else {
-        if (!s->seek)
-            return -EPIPE;
-
 #ifdef CONFIG_MUXERS
         if (s->write_flag) {
             flush_buffer(s);
@@ -136,7 +133,7 @@
             s->buf_end = s->buffer;
         }
         s->buf_ptr = s->buffer;
-        if (s->seek(s->opaque, offset, SEEK_SET) == (offset_t)-EPIPE)
+        if (!s->seek || s->seek(s->opaque, offset, SEEK_SET) == (offset_t)-EPIPE)
             return -EPIPE;
         s->pos = offset;
     }