Mercurial > libavformat.hg
diff aviobuf.c @ 5948:dc1a033edd9f libavformat
Do not set pos to an error value.
Patch by Howard Chu, hyc highlandsun com
author | cehoyos |
---|---|
date | Mon, 12 Apr 2010 15:03:30 +0000 |
parents | b106b59bf663 |
children | d9da72409ff9 |
line wrap: on
line diff
--- a/aviobuf.c Mon Apr 12 07:24:30 2010 +0000 +++ b/aviobuf.c Mon Apr 12 15:03:30 2010 +0000 @@ -743,8 +743,13 @@ return AVERROR(ENOSYS); ret = s->read_seek(h, stream_index, timestamp, flags); if(ret >= 0) { + int64_t pos; s->buf_ptr = s->buf_end; // Flush buffer - s->pos = s->seek(h, 0, SEEK_CUR); + pos = s->seek(h, 0, SEEK_CUR); + if (pos >= 0) + s->pos = pos; + else if (pos != AVERROR(ENOSYS)) + ret = pos; } return ret; }