changeset 3097:81ea8a5488cc

small change in mplayer.c and cfg-mplayer.h
author anders
date Sat, 24 Nov 2001 05:29:56 +0000
parents 15abd9121737
children 6b21035859c9
files cfg-mplayer.h mplayer.c
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mplayer.h	Sat Nov 24 05:24:06 2001 +0000
+++ b/cfg-mplayer.h	Sat Nov 24 05:29:56 2001 +0000
@@ -137,7 +137,7 @@
 	{"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000},
 	{"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1},
 	{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0},
-	{"abs", &ao_buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0},
+	{"abs", &ao_data.buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0},
 	{"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0},
 
 	{"alsa", "Option -alsa has been removed, new audio code doesn't need it! Remove it from your config file!\n",
--- a/mplayer.c	Sat Nov 24 05:24:06 2001 +0000
+++ b/mplayer.c	Sat Nov 24 05:29:56 2001 +0000
@@ -1228,7 +1228,7 @@
   unsigned int t;
   int playsize;
   
-  ao_pts=sh_audio->timer*90000.0;
+  ao_data.pts=sh_audio->timer*90000.0;
   playsize=audio_out->get_space();
   
   if(!playsize) break; // buffer is full, do not block here!!!
@@ -1324,10 +1324,10 @@
     if(drop_frame){
 
       if(sh_audio && !d_audio->eof){
-          int delay=audio_out->get_delay();
-          mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%d\n",delay);
+	  float delay=audio_out->get_delay();
+          mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%f\n",delay);
           time_frame=sh_video->timer;
-          time_frame-=sh_audio->timer-(float)delay/(float)sh_audio->o_bps;
+          time_frame-=sh_audio->timer-delay;
 	  if(time_frame>-2*frame_time) {
 	    drop_frame=0; // stop dropping frames
 	    mp_msg(MSGT_AVSYNC,MSGL_DBG2,"\nstop frame drop %.2f\n", time_frame);
@@ -1348,15 +1348,16 @@
       time_frame-=GetRelativeTime(); // reset timer
 
       if(sh_audio && !d_audio->eof){
-          int delay=audio_out->get_delay();
-          mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%d\n",delay);
+	  float delay=audio_out->get_delay();
+	  mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%f\n",delay);
 
 if(!dapsync){
 
 	      /* Arpi's AV-sync */
 
           time_frame=sh_video->timer;
-          time_frame-=sh_audio->timer-(float)delay/(float)sh_audio->o_bps;
+          time_frame-=sh_audio->timer-delay;
+
           // we are out of time... drop next frame!
 	  if(time_frame<-2*frame_time){
 	      static int drop_message=0;
@@ -1508,8 +1509,7 @@
     float v_pts=0;
 
     // unplayed bytes in our and soundcard/dma buffer:
-    int delay_bytes=audio_out->get_delay()+sh_audio->a_buffer_len;
-    float delay=(float)delay_bytes/(float)sh_audio->o_bps;
+    float delay=audio_out->get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->o_bps;
 
     if(pts_from_bps){
 #if 1