[Mplayer-cvslog] CVS: main/libao2 ao_sdl.c, 1.29, 1.30 ao_win32.c, 1.9, 1.10
Sascha Sommer CVS
syncmail at mplayerhq.hu
Wed Apr 7 19:53:45 CEST 2004
CVS change done by Sascha Sommer CVS
Update of /cvsroot/mplayer/main/libao2
In directory mail:/var2/tmp/cvs-serv15493/libao2
Modified Files:
ao_sdl.c ao_win32.c
Log Message:
round len to outburst and increment full_buffers at the correct time, patch by Nehal <nehalmistry at gmx.net>
Index: ao_sdl.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_sdl.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- ao_sdl.c 6 Apr 2004 17:55:36 -0000 1.29
+++ ao_sdl.c 7 Apr 2004 17:53:42 -0000 1.30
@@ -66,12 +66,13 @@
x=BUFFSIZE-buf_write_pos;
if(x>len) x=len;
memcpy(buffer[buf_write]+buf_write_pos,data+len2,x);
+ if (buf_write_pos==0)
+ ++full_buffers;
len2+=x; len-=x;
buffered_bytes+=x; buf_write_pos+=x;
if(buf_write_pos>=BUFFSIZE){
// block is full, find next!
buf_write=(buf_write+1)%NUM_BUFS;
- ++full_buffers;
buf_write_pos=0;
}
}
@@ -316,6 +317,7 @@
// return: number of bytes played
static int play(void* data,int len,int flags){
+ len = (len/ao_data.outburst)*ao_data.outburst;
#if 0
int ret;
Index: ao_win32.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_win32.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ao_win32.c 6 Apr 2004 18:06:20 -0000 1.9
+++ ao_win32.c 7 Apr 2004 17:53:42 -0000 1.10
@@ -1,6 +1,6 @@
/******************************************************************************
* ao_win32.c: Windows waveOut interface for MPlayer
- * Copyright (c) 2002 Sascha Sommer <saschasommer at freenet.de>.
+ * Copyright (c) 2002 - 2004 Sascha Sommer <saschasommer at freenet.de>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -220,6 +220,7 @@
x=BUFFER_SIZE-buf_write_pos;
if(x>len) x=len;
memcpy(current->lpData+buf_write_pos,data+len2,x);
+ if(buf_write_pos==0)full_buffers++;
len2+=x; len-=x;
buffered_bytes+=x; buf_write_pos+=x;
//prepare header and write data to device
@@ -230,7 +231,6 @@
if(buf_write_pos>=BUFFER_SIZE){ //buffer is full find next
// block is full, find next!
buf_write=(buf_write+1)%BUFFER_COUNT;
- ++full_buffers;
buf_write_pos=0;
}
}
@@ -242,6 +242,7 @@
// return: number of bytes played
static int play(void* data,int len,int flags)
{
+ len = (len/ao_data.outburst)*ao_data.outburst;
return write_waveOutBuffer(data,len);
}
More information about the MPlayer-cvslog
mailing list