small change in mplayer.c and cfg-mplayer.h

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3098 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
anders 2001-11-24 05:29:56 +00:00
parent 44399cfe59
commit 4943e9c52c
2 changed files with 10 additions and 10 deletions

View File

@ -137,7 +137,7 @@ struct config conf[]={
{"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000}, {"loop", &loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000},
{"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1}, {"sound", &has_audio, CONF_TYPE_FLAG, 0, 0, 1},
{"nosound", &has_audio, CONF_TYPE_FLAG, 0, 1, 0}, {"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}, {"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", {"alsa", "Option -alsa has been removed, new audio code doesn't need it! Remove it from your config file!\n",

View File

@ -1228,7 +1228,7 @@ while(sh_audio){
unsigned int t; unsigned int t;
int playsize; int playsize;
ao_pts=sh_audio->timer*90000.0; ao_data.pts=sh_audio->timer*90000.0;
playsize=audio_out->get_space(); playsize=audio_out->get_space();
if(!playsize) break; // buffer is full, do not block here!!! if(!playsize) break; // buffer is full, do not block here!!!
@ -1324,10 +1324,10 @@ if(1)
if(drop_frame){ if(drop_frame){
if(sh_audio && !d_audio->eof){ if(sh_audio && !d_audio->eof){
int delay=audio_out->get_delay(); float delay=audio_out->get_delay();
mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%d\n",delay); mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%f\n",delay);
time_frame=sh_video->timer; 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) { if(time_frame>-2*frame_time) {
drop_frame=0; // stop dropping frames drop_frame=0; // stop dropping frames
mp_msg(MSGT_AVSYNC,MSGL_DBG2,"\nstop frame drop %.2f\n", time_frame); mp_msg(MSGT_AVSYNC,MSGL_DBG2,"\nstop frame drop %.2f\n", time_frame);
@ -1348,15 +1348,16 @@ if(1)
time_frame-=GetRelativeTime(); // reset timer time_frame-=GetRelativeTime(); // reset timer
if(sh_audio && !d_audio->eof){ if(sh_audio && !d_audio->eof){
int delay=audio_out->get_delay(); float delay=audio_out->get_delay();
mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%d\n",delay); mp_dbg(MSGT_AVSYNC,MSGL_DBG2,"delay=%f\n",delay);
if(!dapsync){ if(!dapsync){
/* Arpi's AV-sync */ /* Arpi's AV-sync */
time_frame=sh_video->timer; 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! // we are out of time... drop next frame!
if(time_frame<-2*frame_time){ if(time_frame<-2*frame_time){
static int drop_message=0; static int drop_message=0;
@ -1508,8 +1509,7 @@ if(!(vo_flags&256)){ // flag 256 means: libvo driver does its timing (dvb card)
float v_pts=0; float v_pts=0;
// unplayed bytes in our and soundcard/dma buffer: // unplayed bytes in our and soundcard/dma buffer:
int delay_bytes=audio_out->get_delay()+sh_audio->a_buffer_len; float delay=audio_out->get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->o_bps;
float delay=(float)delay_bytes/(float)sh_audio->o_bps;
if(pts_from_bps){ if(pts_from_bps){
#if 1 #if 1