[PATCH 04/12] Make url_fseek() return AVERROR(ESPIPE) rather than AVERROR(EPIPE) if the seek operation is not defined on the protocol.

Stefano Sabatini stefano.sabatini-lala
Tue Mar 16 23:08:32 CET 2010


---
 libavformat/aviobuf.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index da05251..41657a4 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -159,7 +159,7 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence)
             return AVERROR_EOF;
         s->buf_ptr = s->buf_end + offset - s->pos;
     } else {
-        int64_t res = AVERROR(EPIPE);
+        int64_t res;
 
 #if CONFIG_MUXERS || CONFIG_NETWORK
         if (s->write_flag) {
@@ -167,7 +167,9 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence)
             s->must_flush = 1;
         }
 #endif /* CONFIG_MUXERS || CONFIG_NETWORK */
-        if (!s->seek || (res = s->seek(s->opaque, offset, SEEK_SET)) < 0)
+        if (!s->seek)
+            return AVERROR(ESPIPE);
+        if ((res = s->seek(s->opaque, offset, SEEK_SET)) < 0)
             return res;
         if (!s->write_flag)
             s->buf_end = s->buffer;
-- 
1.6.6.1


--cQXOx3fnlpmgJsTP--



More information about the ffmpeg-devel mailing list