From 20b02bc62801e34f2d561c2f77154604b52e6358 Mon Sep 17 00:00:00 2001 From: Chriss Date: Sun, 5 Dec 2004 02:46:00 +0000 Subject: This patch takes into account that fifo_realloc may adjust fifo.wptr patch by ("Chris" chris at garveycocker dot com) Originally committed as revision 3727 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavformat/mpeg.c') diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index dee7a8a4d1..4e69139662 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -1172,6 +1172,8 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) stream->predecode_packet= pkt_desc; stream->next_packet= &pkt_desc->next; + fifo_realloc(&stream->fifo, fifo_size(&stream->fifo, NULL) + size + 1); + if (s->is_dvd){ if (is_iframe) { stream->fifo_iframe_ptr = stream->fifo.wptr; @@ -1181,7 +1183,6 @@ 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(;;){ -- cgit v1.2.3