From: Harlan Stenn Date: Tue, 7 Sep 2004 10:41:51 +0000 (-0400) Subject: Use SNDCTL_DSP_SETFRAGMENT if available. From Tim Shoppa. X-Git-Tag: NTP_4_2_3~118^2~3^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=540a1b53b84bb2f2aeeda484598e829b5ad17c94;p=thirdparty%2Fntp.git Use SNDCTL_DSP_SETFRAGMENT if available. From Tim Shoppa. bk: 413d906fPfTZikQ8pTe-lrVwpgBmvw --- diff --git a/libntp/audio.c b/libntp/audio.c index 3b39ae0316..8d2f7c2ca9 100644 --- a/libntp/audio.c +++ b/libntp/audio.c @@ -285,6 +285,15 @@ audio_init( s_size.play_size, s_size.rec_size); # endif /* HAVE_STRUCT_SND_SIZE */ +# ifdef SNDCTL_DSP_SETFRAGMENT + { + int tmp = (16 << 16) + 6; /* 16 fragments, each 2^6 bytes */ + if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &tmp) == -1) + printf("audio_init: SNDCTL_DSP_SETFRAGMENT: %s\n", + strerror(errno)); + } +# endif /* SNDCTL_DSP_SETFRAGMENT */ + # ifdef AIOGFMT if (ioctl(fd, AIOGFMT, &s_c_p) == -1) printf("audio_init: AIOGFMT: %s\n", strerror(errno));