summaryrefslogtreecommitdiff
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-12-01 02:28:28 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-12-01 02:28:28 +0000
commit0d71240921397c98af9b42616be2fe4796df8912 (patch)
tree4ac76cd0564551ed74359eb51d9229cf153b61a9 /libavformat/mpeg.c
parent61f4aa96bad7fcca334df1aab5d5236a60bedaca (diff)
fifo_realloc()
Originally committed as revision 3726 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 3b4a5f73cf..dee7a8a4d1 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -391,7 +391,7 @@ static int mpeg_mux_init(AVFormatContext *ctx)
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 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
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 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
}
}
+ fifo_realloc(&stream->fifo, fifo_size(&stream->fifo, NULL) + size + 1);
fifo_write(&stream->fifo, buf, size, &stream->fifo.wptr);
for(;;){