[Mplayer-cvslog] CVS: main/libmpdemux demux_audio.c,1.11,1.12 demux_demuxers.c,1.2,1.3 demuxer.c,1.120,1.121 stheader.h,1.34,1.35

Arpi of Ize arpi at mplayerhq.hu
Sat Nov 2 20:53:02 CET 2002


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

Modified Files:
	demux_audio.c demux_demuxers.c demuxer.c stheader.h 
Log Message:
A-V sync cleanup: sh_audio->timer replaced by sh_audio->delay, it contains
delay relative to sh_video->timer (or to 0 if audioonly).
It fixes ct: drifts of very long (several hours) playback.


Index: demux_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_audio.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- demux_audio.c	23 Oct 2002 17:21:00 -0000	1.11
+++ demux_audio.c	2 Nov 2002 19:52:58 -0000	1.12
@@ -295,7 +295,7 @@
     }
     if(len > 0)
       high_res_mp3_seek(demuxer,len);
-    sh_audio->timer = priv->last_pts -  (ds_tell_pts(demuxer->audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
+    sh_audio->delay = priv->last_pts -  (ds_tell_pts(demuxer->audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
     resync_audio_stream(sh_audio);
     return;
   }
@@ -307,13 +307,13 @@
     pos = base + (rel_seek_secs*sh_audio->i_bps);
 
   if(demuxer->movi_end && pos >= demuxer->movi_end) {
-    sh_audio->timer = (stream_tell(s) - demuxer->movi_start)/(float)sh_audio->i_bps;
+    sh_audio->delay = (stream_tell(s) - demuxer->movi_start)/(float)sh_audio->i_bps;
     return;
   } else if(pos < demuxer->movi_start)
     pos = demuxer->movi_start;
 
   priv->last_pts = (pos-demuxer->movi_start)/(float)sh_audio->i_bps;
-  sh_audio->timer = priv->last_pts - (ds_tell_pts(demuxer->audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
+  sh_audio->delay = priv->last_pts - (ds_tell_pts(demuxer->audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
   
   switch(priv->frmt) {
   case WAV:

Index: demux_demuxers.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_demuxers.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- demux_demuxers.c	24 Apr 2002 17:28:23 -0000	1.2
+++ demux_demuxers.c	2 Nov 2002 19:52:59 -0000	1.3
@@ -73,8 +73,7 @@
     // In case the demuxer don't set pts
     if(!demuxer->audio->pts)
       demuxer->audio->pts = pos-((ds_tell_pts(demuxer->audio)-sh->a_in_buffer_len)/(float)sh->i_bps);
-    if(sh->timer)
-      sh->timer = 0;
+    sh->delay = 0;
   }
 
   if(priv->sd != priv->vd)

Index: demuxer.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- demuxer.c	2 Nov 2002 00:45:12 -0000	1.120
+++ demuxer.c	2 Nov 2002 19:52:59 -0000	1.121
@@ -1135,7 +1135,7 @@
 #if 0
     if(sh_audio) sh_audio->timer=sh_video->timer;
 #else
-    if(sh_audio) sh_audio->timer=0;
+    if(sh_audio) sh_audio->delay=0;
     if(sh_video) sh_video->timer=0; // !!!!!!
 #endif
 

Index: stheader.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/stheader.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- stheader.h	5 Oct 2002 22:55:45 -0000	1.34
+++ stheader.h	2 Nov 2002 19:52:59 -0000	1.35
@@ -46,7 +46,7 @@
   struct codecs_st *codec;
   unsigned int format;
   int inited;
-  float timer;		   // value of old a_frame
+  float delay;		   // value of old a_frame
   // output format:
   int sample_format;
   int samplerate;




More information about the MPlayer-cvslog mailing list