[Ffmpeg-cvslog] r7766 - trunk/libavformat/aviobuf.c

gpoirier subversion
Tue Jan 30 11:48:39 CET 2007


Author: gpoirier
Date: Tue Jan 30 11:48:39 2007
New Revision: 7766

Modified:
   trunk/libavformat/aviobuf.c

Log:
Fix misbehaviour in url_fseek() when seeking fails.
The return value of the seek function is -1 on error, not -EPIPE (the return value in url_seek() if no seek function pointer is set)
Patch by Ronald S. Bultje % rbultje A ronald P bitfreak P net %
Original thread:
date: Dec 31, 2006 9:25 PM
subject: [Ffmpeg-devel] Re: [PATCH] file length handling


Modified: trunk/libavformat/aviobuf.c
==============================================================================
--- trunk/libavformat/aviobuf.c	(original)
+++ trunk/libavformat/aviobuf.c	Tue Jan 30 11:48:39 2007
@@ -136,6 +136,8 @@
             fill_buffer(s);
         s->buf_ptr = s->buf_end + offset - s->pos;
     } else {
+        offset_t res = -EPIPE;
+
 #if defined(CONFIG_MUXERS) || defined(CONFIG_NETWORK)
         if (s->write_flag) {
             flush_buffer(s);
@@ -146,8 +148,8 @@
             s->buf_end = s->buffer;
         }
         s->buf_ptr = s->buffer;
-        if (!s->seek || s->seek(s->opaque, offset, SEEK_SET) == (offset_t)-EPIPE)
-            return -EPIPE;
+        if (!s->seek || (res = s->seek(s->opaque, offset, SEEK_SET)) < 0)
+            return res;
         s->pos = offset;
     }
     s->eof_reached = 0;




More information about the ffmpeg-cvslog mailing list