comparison aviobuf.c @ 5850:a9a36b4f83a2 libavformat

Add AVSEEK_FORCE flag to indicate that the code should attempt to seek by any means.
author michael
date Mon, 15 Mar 2010 22:54:22 +0000
parents 26c471598b2f
children a1121e5fa662
comparison
equal deleted inserted replaced
5849:219b4cc8f378 5850:a9a36b4f83a2
148 offset1 = offset - pos; 148 offset1 = offset - pos;
149 if (!s->must_flush && 149 if (!s->must_flush &&
150 offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) { 150 offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) {
151 /* can do the seek inside the buffer */ 151 /* can do the seek inside the buffer */
152 s->buf_ptr = s->buffer + offset1; 152 s->buf_ptr = s->buffer + offset1;
153 } else if(s->is_streamed && !s->write_flag && 153 } else if(s->is_streamed && !s->write_flag && offset1 >= 0 &&
154 offset1 >= 0 && offset1 < (s->buf_end - s->buffer) + (1<<16)){ 154 ( offset1 < (s->buf_end - s->buffer) + (1<<16)
155 || (whence & AVSEEK_FORCE))){
155 while(s->pos < offset && !s->eof_reached) 156 while(s->pos < offset && !s->eof_reached)
156 fill_buffer(s); 157 fill_buffer(s);
157 if (s->eof_reached) 158 if (s->eof_reached)
158 return AVERROR(EPIPE); 159 return AVERROR(EPIPE);
159 s->buf_ptr = s->buf_end + offset - s->pos; 160 s->buf_ptr = s->buf_end + offset - s->pos;