Mercurial > libavformat.hg
diff mpeg.c @ 602:15cf78d9aceb libavformat
fifo_realloc()
| author | michael |
|---|---|
| date | Wed, 01 Dec 2004 02:28:28 +0000 |
| parents | 4c53352471f2 |
| children | 0b266c470c96 |
line wrap: on
line diff
--- a/mpeg.c Tue Nov 30 21:57:51 2004 +0000 +++ b/mpeg.c Wed Dec 01 02:28:28 2004 +0000 @@ -391,7 +391,7 @@ default: return -1; } - fifo_init(&stream->fifo, 2*stream->max_buffer_size + 100*MAX_PAYLOAD_SIZE); //FIXME think about the size maybe dynamically realloc + fifo_init(&stream->fifo, 16); stream->next_packet= &stream->premux_packet; } bitrate = 0; @@ -1172,11 +1172,6 @@ stream->predecode_packet= pkt_desc; stream->next_packet= &pkt_desc->next; - if(stream->fifo.end - stream->fifo.buffer - fifo_size(&stream->fifo, stream->fifo.rptr) < size){ - av_log(ctx, AV_LOG_ERROR, "fifo overflow\n"); - return -1; - } - if (s->is_dvd){ if (is_iframe) { stream->fifo_iframe_ptr = stream->fifo.wptr; @@ -1186,6 +1181,7 @@ } } + fifo_realloc(&stream->fifo, fifo_size(&stream->fifo, NULL) + size + 1); fifo_write(&stream->fifo, buf, size, &stream->fifo.wptr); for(;;){
