From c6a5e087cf619775c18386c48711b7aa5efe059e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= Date: Wed, 24 Mar 2010 10:41:58 +0000 Subject: [PATCH] =?UTF-8?q?Mask=20away=20AVSEEK=5FFORCE=20properly=20in=20?= =?UTF-8?q?some=20checks=20in=20url=5Ffseek()=20Patch=20by=20Tomas=20H?= =?UTF-8?q?=C3=A4rdin=20$(name).$(s/=C3=A4/a/=20$(surname))=20AT=20codemil?= =?UTF-8?q?l=20DOT=20se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 22653 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/aviobuf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index da05251279..37a6f6dee3 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -130,6 +130,8 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence) { int64_t offset1; int64_t pos; + int force = whence & AVSEEK_FORCE; + whence &= ~AVSEEK_FORCE; if(!s) return AVERROR(EINVAL); @@ -151,8 +153,7 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence) /* can do the seek inside the buffer */ s->buf_ptr = s->buffer + offset1; } else if(s->is_streamed && !s->write_flag && offset1 >= 0 && - ( offset1 < (s->buf_end - s->buffer) + (1<<16) - || (whence & AVSEEK_FORCE))){ + (offset1 < (s->buf_end - s->buffer) + (1<<16) || force)) { while(s->pos < offset && !s->eof_reached) fill_buffer(s); if (s->eof_reached)