Commit c6a5e087 authored by Tomas Härdin's avatar Tomas Härdin Committed by Benoit Fouet

Mask away AVSEEK_FORCE properly in some checks in url_fseek()

Patch by Tomas Härdin $(name).$(s/ä/a/ $(surname)) AT codemill DOT se

Originally committed as revision 22653 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 06ebe916
...@@ -130,6 +130,8 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence) ...@@ -130,6 +130,8 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence)
{ {
int64_t offset1; int64_t offset1;
int64_t pos; int64_t pos;
int force = whence & AVSEEK_FORCE;
whence &= ~AVSEEK_FORCE;
if(!s) if(!s)
return AVERROR(EINVAL); return AVERROR(EINVAL);
...@@ -151,8 +153,7 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence) ...@@ -151,8 +153,7 @@ int64_t url_fseek(ByteIOContext *s, int64_t offset, int whence)
/* can do the seek inside the buffer */ /* can do the seek inside the buffer */
s->buf_ptr = s->buffer + offset1; s->buf_ptr = s->buffer + offset1;
} else if(s->is_streamed && !s->write_flag && offset1 >= 0 && } else if(s->is_streamed && !s->write_flag && offset1 >= 0 &&
( offset1 < (s->buf_end - s->buffer) + (1<<16) (offset1 < (s->buf_end - s->buffer) + (1<<16) || force)) {
|| (whence & AVSEEK_FORCE))){
while(s->pos < offset && !s->eof_reached) while(s->pos < offset && !s->eof_reached)
fill_buffer(s); fill_buffer(s);
if (s->eof_reached) if (s->eof_reached)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment