[MPlayer-dev-eng] [PATCH] infinite loop setting NI mode in libmpdemux/demux_avi.c

Pavel Troller patrol at sinus.cz
Thu Aug 11 07:32:09 CEST 2005


Hi!
  Using CVS, I found that I cannot play some vids - a warning about switching
to -ni mode was being printed ad infinitum and nothing more happened.
  I've found that this is probably due to the fact that the NI mode is set
automatically if a "badly interlaced file" is found but the index position is
then decremented so the same check hits again and because there is no check
whether the NI mode is already set, the program loops.
  The attached patch fixes this problem by adding this additional check,
whether the NI mode is already set.
  Now the program prints the message once and then continues, finally starting
to play the file.
  Please reply to me directly if necessary, I'm not subscribed to the list.
  
                               With regards, Pavel Troller
-------------- next part --------------
--- xxxx	2005-08-11 07:17:48.000000000 +0200
+++ demux_avi.c	2005-08-11 07:11:37.000000000 +0200
@@ -265,7 +265,9 @@
 
   ds=demux_avi_select_stream(demux,id);
   if(ds)
-    if(ds->packs+1>=MAX_PACKS || ds->bytes+len>=MAX_PACK_BYTES){
+    if((ds->packs+1>=MAX_PACKS || ds->bytes+len>=MAX_PACK_BYTES) && \
+		    (demux->type!=DEMUXER_TYPE_AVI_NI && \
+		     demux->type!=DEMUXER_TYPE_AVI_NINI)){
 	// this packet will cause a buffer overflow, switch to -ni mode!!!
 	mp_msg(MSGT_DEMUX,MSGL_WARN,MSGTR_SwitchToNi);
 	if(priv->idx_size>0){


More information about the MPlayer-dev-eng mailing list