aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChriss <chris@garveycocker.com>2004-12-05 02:46:00 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-12-05 02:46:00 +0000
commit20b02bc62801e34f2d561c2f77154604b52e6358 (patch)
tree8f0ea110ac4934694361aa7950054ca5feb693d4
parent0d71240921397c98af9b42616be2fe4796df8912 (diff)
downloadffmpeg-20b02bc62801e34f2d561c2f77154604b52e6358.tar.gz
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
-rw-r--r--libavformat/mpeg.c3
1 files changed, 2 insertions, 1 deletions
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(;;){