summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-05-21 20:36:06 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-05-21 20:36:06 +0000
commit8851e1a66d79d6a88f4dbd053ed1545335ca5422 (patch)
tree3f926e521e7fca92c208a131b1bb4b77580d8fb1
parentd57cabdb9f5c2890a40d047ac9087e8e1f11613d (diff)
downloadxine-lib-8851e1a66d79d6a88f4dbd053ed1545335ca5422.tar.gz
xine-lib-8851e1a66d79d6a88f4dbd053ed1545335ca5422.tar.bz2
patch from Ian Goldberg <ian@cypherpunks.ca>:
"The logic to detect if your soundcard supports hardware A/V sync was wrong (for my card, cs4232, at least). The code did a check for DSP_CAP_REALTIME, and if that failed, didn't bother to check whether SNDCTL_DSP_GETODELAY or SNDCTL_DSP_GETOPTR worked." CVS patchset: 1925 CVS date: 2002/05/21 20:36:06
-rw-r--r--src/audio_out/audio_oss_out.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index 25cbc22f4..aaad9abc2 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_oss_out.c,v 1.63 2002/05/02 10:24:10 heikos Exp $
+ * $Id: audio_oss_out.c,v 1.64 2002/05/21 20:36:06 miguelfreitas Exp $
*
* 20-8-2001 First implementation of Audio sync and Audio driver separation.
* Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk
@@ -700,27 +700,19 @@ ao_driver_t *init_audio_out_plugin (config_values_t *config) {
if (this->sync_method == OSS_SYNC_AUTO_DETECT) {
- ioctl (audio_fd, SNDCTL_DSP_GETCAPS, &caps);
-
- if ((caps & DSP_CAP_REALTIME) > 0) {
+ count_info info;
- count_info info;
+ /*
+ * check if SNDCTL_DSP_GETODELAY works. if so, using it is preferred.
+ */
- /*
- * check if SNDCTL_DSP_GETODELAY works. if so, using it is preferred.
- */
-
- if (ioctl(audio_fd, SNDCTL_DSP_GETODELAY, &info) != -1) {
- printf("audio_oss_out: using SNDCTL_DSP_GETODELAY\n");
- this->sync_method = OSS_SYNC_GETODELAY;
- } else if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) != -1) {
- printf("audio_oss_out: using SNDCTL_DSP_GETOPTR\n");
- this->sync_method = OSS_SYNC_GETOPTR;
- } else
- this->sync_method = OSS_SYNC_SOFTSYNC;
+ if (ioctl(audio_fd, SNDCTL_DSP_GETODELAY, &info) != -1) {
+ printf("audio_oss_out: using SNDCTL_DSP_GETODELAY\n");
+ this->sync_method = OSS_SYNC_GETODELAY;
+ } else if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &info) != -1) {
+ printf("audio_oss_out: using SNDCTL_DSP_GETOPTR\n");
+ this->sync_method = OSS_SYNC_GETOPTR;
} else {
- printf ("audio_oss_out: realtime check: *FAILED*\n");
-
this->sync_method = OSS_SYNC_SOFTSYNC;
}
}