Mercurial > libavformat.hg
changeset 1326:142fb755fbf5 libavformat
support forward seeking in non seekable streams
author | michael |
---|---|
date | Tue, 26 Sep 2006 17:09:03 +0000 |
parents | 9e739042d95c |
children | dac7743ba1ee |
files | aviobuf.c |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/aviobuf.c Tue Sep 26 16:09:56 2006 +0000 +++ b/aviobuf.c Tue Sep 26 17:09:03 2006 +0000 @@ -22,6 +22,8 @@ #define IO_BUFFER_SIZE 32768 +static void fill_buffer(ByteIOContext *s); + int init_put_byte(ByteIOContext *s, unsigned char *buffer, int buffer_size, @@ -122,6 +124,11 @@ offset1 >= 0 && offset1 < (s->buf_end - s->buffer)) { /* 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)){ + while(s->pos < offset && !s->eof_reached) + fill_buffer(s); + s->buf_ptr = s->buf_end + offset - s->pos; } else { #ifdef CONFIG_MUXERS if (s->write_flag) {