Mercurial > mplayer.hg
changeset 7495:12b2c735ad07
removed -dapsync (obsolete code)
author | arpi |
---|---|
date | Mon, 23 Sep 2002 22:12:29 +0000 |
parents | 229287c14cd4 |
children | 3d35a56799fc |
files | cfg-mplayer.h mplayer.c |
diffstat | 2 files changed, 4 insertions(+), 47 deletions(-) [+] |
line wrap: on
line diff
--- a/cfg-mplayer.h Mon Sep 23 22:05:09 2002 +0000 +++ b/cfg-mplayer.h Mon Sep 23 22:12:29 2002 +0000 @@ -346,8 +346,9 @@ {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL}, // a-v sync stuff: - {"dapsync", &dapsync, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nodapsync", &dapsync, CONF_TYPE_FLAG, 0, 1, 0, NULL}, +// {"dapsync", &dapsync, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +// {"nodapsync", &dapsync, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"softsleep", &softsleep, CONF_TYPE_FLAG, 0, 0, 1, NULL}, #ifdef HAVE_RTC {"nortc", &nortc, CONF_TYPE_FLAG, 0, 0, 1, NULL},
--- a/mplayer.c Mon Sep 23 22:05:09 2002 +0000 +++ b/mplayer.c Mon Sep 23 22:12:29 2002 +0000 @@ -209,7 +209,6 @@ static float c_total=0; float audio_delay=0; -static int dapsync=0; static int softsleep=0; static float force_fps=0; @@ -1610,53 +1609,10 @@ 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-delay; - } else { // if(!dapsync) - - /* DaP's AV-sync */ - - float SH_AV_delay; - /* SH_AV_delay = sh_video->timer - (sh_audio->timer - (float)((float)delay + sh_audio->a_buffer_len) / (float)sh_audio->o_bps); */ - SH_AV_delay = sh_video->timer - (sh_audio->timer - (float)((float)delay) / (float)sh_audio->o_bps); - // printf ("audio slp req: %.3f TF: %.3f delta: %.3f (v: %.3f a: %.3f) | ", i, time_frame, - // i - time_frame, sh_video->timer, sh_audio->timer - (float)((float)delay / (float)sh_audio->o_bps)); - if(SH_AV_delay<-2*frame_time){ - drop_frame=frame_dropping; // tricky! - ++drop_frame_cnt; - mp_msg(MSGT_AVSYNC,MSGL_INFO,"A-V SYNC: FRAMEDROP (SH_AV_delay=%.3f)!\n", SH_AV_delay); - mp_msg(MSGT_AVSYNC,MSGL_DBG2,"\nframe drop %d, %.2f\n", drop_frame, time_frame); - /* go into unlimited-TF cycle */ - time_frame = SH_AV_delay; - } else { -#define SL_CORR_AVG_LEN 125 - /* don't adjust under framedropping */ - time_frame_corr_avg = (time_frame_corr_avg * (SL_CORR_AVG_LEN - 1) + - (SH_AV_delay - time_frame)) / SL_CORR_AVG_LEN; -#define UNEXP_CORR_MAX 0.1 /* limit of unexpected correction between two frames (percentage) */ -#define UNEXP_CORR_WARN 1.0 /* warn limit of A-V lag (percentage) */ - time_frame += time_frame_corr_avg; - // printf ("{%.3f - %.3f}\n", i - time_frame, frame_time + frame_time_corr_avg); - if (SH_AV_delay - time_frame < (frame_time + time_frame_corr_avg) * UNEXP_CORR_MAX && - SH_AV_delay - time_frame > (frame_time + time_frame_corr_avg) * -UNEXP_CORR_MAX) - time_frame = SH_AV_delay; - else { - if (SH_AV_delay - time_frame > (frame_time + time_frame_corr_avg) * UNEXP_CORR_WARN || - SH_AV_delay - time_frame < (frame_time + time_frame_corr_avg) * -UNEXP_CORR_WARN) - mp_msg(MSGT_AVSYNC, MSGL_WARN, "WARNING: A-V SYNC LAG TOO LARGE: %.3f {%.3f - %.3f} (too little UNEXP_CORR_MAX?)\n", - SH_AV_delay - time_frame, SH_AV_delay, time_frame); - time_frame += (frame_time + time_frame_corr_avg) * ((SH_AV_delay > time_frame) ? - UNEXP_CORR_MAX : -UNEXP_CORR_MAX); - } - } /* /start dropframe */ - - } // if(dapsync) - + // delay = amount of audio buffered in soundcard/driver if(delay>0.25) delay=0.25; else if(delay<0.10) delay=0.10; if(time_frame>delay*0.6){