[Ffmpeg-devel] buffer underflow messages from the output_example.c

Wolfram Gloger wmglo
Mon Apr 23 13:06:17 CEST 2007


Hi,

> i rather think that theres a pkt_desc=3D ... missing in the loop (patch
> welcome if regression tests pass ...)

Ok here goes..   I have this in my tree for about 18 months and it
has never affected regression tests
(the recent seek test excepted but that doesn't pass for me with vanilla
ffmpeg either).

Regards,
Wolfram.

diff -Naur trunk/libavformat/mpeg.c ffmpeg-wg/libavformat/mpeg.c
--- trunk/libavformat/mpeg.c	Mon Apr  9 21:49:10 2007
+++ ffmpeg-wg/libavformat/mpeg.c	Sat Apr 14 23:12:13 2007
@@ -1028,12 +1028,15 @@
     for(i=0; i<ctx->nb_streams; i++){
         AVStream *st = ctx->streams[i];
         StreamInfo *stream = st->priv_data;
-        PacketDesc *pkt_desc= stream->predecode_packet;
+        PacketDesc *pkt_desc;
 
-        while(pkt_desc && scr > pkt_desc->dts){ //FIXME > vs >=
+        while((pkt_desc= stream->predecode_packet)
+              && scr > pkt_desc->dts){ //FIXME > vs >=
             if(stream->buffer_index < pkt_desc->size ||
                stream->predecode_packet == stream->premux_packet){
-                av_log(ctx, AV_LOG_ERROR, "buffer underflow\n");
+                av_log(ctx, AV_LOG_ERROR,
+                       "buffer underflow i=%d bufi=%d size=%d\n",
+                       i, stream->buffer_index, pkt_desc->size);
                 break;
             }
             stream->buffer_index -= pkt_desc->size;




More information about the ffmpeg-devel mailing list