diff mencoder.c @ 8030:2b39ff3860b7

cleanup of .AVI timestamp calculation (ugly hack from mplayer.c removed, instead doing it in demux_avi.c, storing private data in priv insteda of demuxer structs)
author arpi
date Sat, 02 Nov 2002 00:45:12 +0000
parents b9da278e4c92
children 136e7e515764
line wrap: on
line diff
--- a/mencoder.c	Sat Nov 02 00:27:57 2002 +0000
+++ b/mencoder.c	Sat Nov 02 00:45:12 2002 +0000
@@ -647,7 +647,7 @@
 	mux_v->bih->biCompression, (char *)&mux_v->bih->biCompression);
 }
 
-if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf!
+//if(demuxer->file_format!=DEMUXER_TYPE_AVI) pts_from_bps=0; // it must be 0 for mpeg/asf!
 
 // ============= AUDIO ===============
 if(sh_audio){
@@ -1053,6 +1053,7 @@
 if(sh_audio && !demuxer2){
     float AV_delay,x;
     // A-V sync!
+#if 0
     if(pts_from_bps){
         unsigned int samples=(sh_audio->audio.dwSampleSize)?
           ((ds_tell(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->audio.dwSampleSize) :
@@ -1060,7 +1061,9 @@
 //	printf("samples=%d  \n",samples);
         a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate;
       delay_corrected=1;
-    } else {
+    } else 
+#endif
+    {
       // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec)
       a_pts=d_audio->pts;
       if(!delay_corrected) if(a_pts) delay_corrected=1;
@@ -1103,10 +1106,12 @@
     {	float t=(GetTimerMS()-timer_start)*0.001f;
 	float len=(demuxer->movi_end-demuxer->movi_start);
 	float p=len>1000 ? (float)(demuxer->filepos-demuxer->movi_start) / len : 0;
+#if 0
 	if(!len && sh_audio && sh_audio->audio.dwLength>100){
 	    p=(sh_audio->audio.dwSampleSize? ds_tell(sh_audio->ds)/sh_audio->audio.dwSampleSize : sh_audio->ds->block_no)
 	     / (float)(sh_audio->audio.dwLength);
 	}
+#endif
 #if 0
 	mp_msg(MSGT_AVSYNC,MSGL_STATUS,"%d < %d < %d  \r",
 	    (int)demuxer->movi_start,