Mercurial > libavformat.hg
changeset 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 | 8b59caee931c |
children | fcdf61a4a6ce |
files | aviobuf.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
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; }