[Mplayer-cvslog] CVS: main/libmpdemux demux_avi.c,1.48,1.49

Arpi of Ize arpi at mplayerhq.hu
Sat Nov 2 22:53:11 CET 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv12856

Modified Files:
	demux_avi.c 
Log Message:
workaround old mencoder's cbr-mp3 header bug


Index: demux_avi.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_avi.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- demux_avi.c	2 Nov 2002 00:45:12 -0000	1.48
+++ demux_avi.c	2 Nov 2002 21:52:48 -0000	1.49
@@ -46,11 +46,18 @@
 		priv->audio_block_size=sh->wf->nChannels*(sh->wf->wBitsPerSample/8);
 	    else
 		priv->audio_block_size=1; // hope the best...
+	  } else {
+	    // workaround old mencoder's bug:
+	    if(sh->audio.dwSampleSize==1 && sh->audio.dwScale==1 &&
+	       (sh->wf->nBlockAlign==1152 || sh->wf->nBlockAlign==576)){
+		mp_msg(MSGT_DEMUX,MSGL_WARN,"AVI: Workarounding CBR-MP3 nBlockAlign header bug!\n");
+		priv->audio_block_size=1;
+	    }
 	  }
 	} else {
 	  priv->audio_block_size=sh->audio.dwSampleSize;
 	}
-	//printf("&&&&& setting blocksize to %d &&&&&\n",demux->audio->block_size);
+//	printf("&&&&& setting blocksize to %d &&&&&\n",priv->audio_block_size);
       }
       return demux->audio;
   }
@@ -125,6 +132,7 @@
       // update blockcount:
       priv->audio_block_no+=priv->audio_block_size ?
 	((len+priv->audio_block_size-1)/priv->audio_block_size) : 1;
+//      printf("\raudio_block_no=%d      \n",priv->audio_block_no);
   } else 
   if(ds==demux->video){
      // video
@@ -151,6 +159,7 @@
   
   if(ds){
     mp_dbg(MSGT_DEMUX,MSGL_DBG2,"DEMUX_AVI: Read %d data bytes from packet %04X\n",len,id);
+//    printf("READ[%c] %5.3f  (%d)   \n",ds==demux->video?'V':'A',pts,len);
     ds_read_packet(ds,demux->stream,len,pts,idxpos,flags);
     skip-=len;
   }




More information about the MPlayer-cvslog mailing list