mirror of https://github.com/mpv-player/mpv
freq fix, removed muxer delay
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4332 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
cb3dfa35e4
commit
6cf2fc4f19
|
@ -22,7 +22,7 @@ static int control(int cmd,int arg){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int freq=0;
|
||||||
static int freq_id=0;
|
static int freq_id=0;
|
||||||
|
|
||||||
// open & setup audio device
|
// open & setup audio device
|
||||||
|
@ -31,6 +31,7 @@ static int init(int rate,int channels,int format,int flags){
|
||||||
|
|
||||||
ao_data.outburst=2000;
|
ao_data.outburst=2000;
|
||||||
ao_data.format=format;
|
ao_data.format=format;
|
||||||
|
freq=rate;
|
||||||
|
|
||||||
switch(rate){
|
switch(rate){
|
||||||
case 48000: freq_id=0;break;
|
case 48000: freq_id=0;break;
|
||||||
|
@ -73,11 +74,11 @@ extern int vo_pts;
|
||||||
|
|
||||||
// return: how many bytes can be played without blocking
|
// return: how many bytes can be played without blocking
|
||||||
static int get_space(){
|
static int get_space(){
|
||||||
float x=(float)(vo_pts-ao_data.pts)/90000.0-0.5;
|
float x=(float)(vo_pts-ao_data.pts)/90000.0;
|
||||||
int y;
|
int y;
|
||||||
if(x<=0) return 0;
|
if(x<=0) return 0;
|
||||||
y=48000*4*x;y/=ao_data.outburst;y*=ao_data.outburst;
|
y=freq*4*x;y/=ao_data.outburst;y*=ao_data.outburst;
|
||||||
// if(y>2000) y=2000;
|
if(y>32000) y=32000;
|
||||||
// printf("diff: %5.3f -> %d \n",x,y);
|
// printf("diff: %5.3f -> %d \n",x,y);
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue