[xiph-cvs] cvs commit: ao/src/plugins/oss ao_oss.c
Warren Dukes
shank at xiph.org
Mon Mar 8 16:05:45 PST 2004
shank 04/03/08 19:05:45
Modified: src/plugins/oss ao_oss.c
Log:
do GETBLKSIZE after setting bitrate, sample size, and channels
b/c the optimal fragment size depends on these settings, but also
GEBLKSIZE causes the fragment size to be set (which cannot be changed
w/o closing and reopening the device).
This fixes a problem a user was having with oss emu10k1 driver where
libao app's were skipping.
Revision Changes Path
1.17 +11 -10 ao/src/plugins/oss/ao_oss.c
Index: ao_oss.c
===================================================================
RCS file: /usr/local/cvsroot/ao/src/plugins/oss/ao_oss.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ao_oss.c 4 Oct 2003 15:16:05 -0000 1.16
+++ ao_oss.c 9 Mar 2004 00:05:44 -0000 1.17
@@ -220,16 +220,6 @@
/* Now set all of the parameters */
- internal->buf_size = -1;
- if ((ioctl(internal->fd,SNDCTL_DSP_GETBLKSIZE,
- &(internal->buf_size)) < 0) ||
- internal->buf_size<=0 )
- {
- fprintf(stderr, "libao - OSS cannot get buffer size for "
- " device\n");
- goto ERR;
- }
-
switch (format->channels)
{
case 1: tmp = 0;
@@ -279,6 +269,17 @@
goto ERR;
}
+ /* this calculates and sets the fragment size */
+ internal->buf_size = -1;
+ if ((ioctl(internal->fd,SNDCTL_DSP_GETBLKSIZE,
+ &(internal->buf_size)) < 0) ||
+ internal->buf_size<=0 )
+ {
+ fprintf(stderr, "libao - OSS cannot get buffer size for "
+ " device\n");
+ goto ERR;
+ }
+
return 1; /* Open successful */
ERR:
<p><p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list