[Mplayer-cvslog] CVS: main mencoder.c,1.180,1.181 mplayer.c,1.606,1.607

Arpi of Ize arpi at mplayerhq.hu
Sat Nov 2 01:45:14 CET 2002


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

Modified Files:
	mencoder.c mplayer.c 
Log Message:
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)


Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -r1.180 -r1.181
--- mencoder.c	1 Nov 2002 17:46:41 -0000	1.180
+++ mencoder.c	2 Nov 2002 00:45:11 -0000	1.181
@@ -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,

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.606
retrieving revision 1.607
diff -u -r1.606 -r1.607
--- mplayer.c	1 Nov 2002 17:46:41 -0000	1.606
+++ mplayer.c	2 Nov 2002 00:45:11 -0000	1.607
@@ -1369,7 +1369,7 @@
 if (!sh_video && !sh_audio)
     goto goto_next_file;
 
-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!
 if(force_fps && sh_video){
   vo_fps = sh_video->fps=force_fps;
   sh_video->frametime=1.0f/sh_video->fps;
@@ -1697,6 +1697,7 @@
       delay+=(float)sh_audio->a_buffer_len/(float)sh_audio->o_bps;
     }
 
+#if 0
     if(pts_from_bps){
 	// PTS = sample_no / samplerate
         unsigned int samples=
@@ -1707,7 +1708,9 @@
         a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate;
 	delay_corrected=1;
 	a_pts-=(sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
-    } 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;




More information about the MPlayer-cvslog mailing list