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
pull/126/head
Chriss 20 years ago committed by Michael Niedermayer
parent 0d71240921
commit 20b02bc628
  1. 3
      libavformat/mpeg.c

@ -1172,6 +1172,8 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
stream->predecode_packet= pkt_desc; stream->predecode_packet= pkt_desc;
stream->next_packet= &pkt_desc->next; stream->next_packet= &pkt_desc->next;
fifo_realloc(&stream->fifo, fifo_size(&stream->fifo, NULL) + size + 1);
if (s->is_dvd){ if (s->is_dvd){
if (is_iframe) { if (is_iframe) {
stream->fifo_iframe_ptr = stream->fifo.wptr; 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); fifo_write(&stream->fifo, buf, size, &stream->fifo.wptr);
for(;;){ for(;;){

Loading…
Cancel
Save