1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-20 06:46:55 +00:00

good-looking fix by Tobias Diedrich <td@informatik.uni-hannover.de>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4915 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-03-02 18:54:58 +00:00
parent 748d1f76aa
commit 3d61c6346f

View File

@ -14,6 +14,8 @@ static ao_info_t info =
LIBAO_EXTERN(pcm) LIBAO_EXTERN(pcm)
extern int vo_pts;
char *ao_outputfilename = NULL; char *ao_outputfilename = NULL;
int ao_pcm_waveheader = 1; int ao_pcm_waveheader = 1;
@ -82,7 +84,7 @@ static int init(int rate,int channels,int format,int flags){
printf("PCM: Info - to write WAVE files use -waveheader (default), for RAW PCM -nowaveheader.\n"); printf("PCM: Info - to write WAVE files use -waveheader (default), for RAW PCM -nowaveheader.\n");
fp = fopen(ao_outputfilename, "wb"); fp = fopen(ao_outputfilename, "wb");
ao_data.outburst = 4096; ao_data.outburst = 65536;
if(fp) { if(fp) {
@ -98,7 +100,7 @@ static int init(int rate,int channels,int format,int flags){
static void uninit(){ static void uninit(){
if(ao_pcm_waveheader){ /* Write wave header */ if(ao_pcm_waveheader){ /* Write wave header */
wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr); wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8;
fseek(fp, 0, SEEK_SET); fseek(fp, 0, SEEK_SET);
fwrite(&wavhdr,sizeof(wavhdr),1,fp); fwrite(&wavhdr,sizeof(wavhdr),1,fp);
} }
@ -126,7 +128,7 @@ static void audio_resume()
// 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(){
return ao_data.outburst; return ao_data.pts < vo_pts ? ao_data.outburst : 0;
} }
// plays 'len' bytes of 'data' // plays 'len' bytes of 'data'