diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-04-21 21:19:25 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-04-21 21:19:25 +0000 |
commit | 9d30e0682a792436e1880fd6ce51966d50ec9c2b (patch) | |
tree | 317ba6a23fe8b0ab1d2e11fed063b256f602c58f | |
parent | 9a32573b49aeade82c250efb8925970fac78f460 (diff) | |
download | ffmpeg-9d30e0682a792436e1880fd6ce51966d50ec9c2b.tar.gz |
Do not initialize res in url_fseek(), in the case !s->seek directly
return AVERROR(EPIPE) rather than the pre-defined value of res.
Slightly improve readability.
Originally committed as revision 22939 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/aviobuf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 1746d03aae..8684903464 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -160,7 +160,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) { @@ -168,7 +168,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(EPIPE); + if ((res = s->seek(s->opaque, offset, SEEK_SET)) < 0) return res; if (!s->write_flag) s->buf_end = s->buffer; |