Mercurial > libavformat.hg
changeset 5977:6eada15742a7 libavformat
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.
author | stefano |
---|---|
date | Wed, 21 Apr 2010 21:19:25 +0000 |
parents | e46f8cc350ef |
children | b8882d9bad80 |
files | aviobuf.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/aviobuf.c Wed Apr 21 13:00:48 2010 +0000 +++ b/aviobuf.c Wed Apr 21 21:19:25 2010 +0000 @@ -160,7 +160,7 @@ 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 @@ 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;