Mercurial > mplayer.hg
changeset 7843:ef4046febd24
OSS is optional (fixes case when "tv" enabled, and "ossaudio" disabled)
patch by Chad Netzer <cnetzer@sonic.net>
author | arpi |
---|---|
date | Tue, 22 Oct 2002 15:14:30 +0000 |
parents | 0e39a6112333 |
children | ba459e95d27a |
files | libmpdemux/audio_in.c |
diffstat | 1 files changed, 16 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/audio_in.c Tue Oct 22 15:09:36 2002 +0000 +++ b/libmpdemux/audio_in.c Tue Oct 22 15:14:30 2002 +0000 @@ -31,10 +31,12 @@ ai->alsa.device = strdup("default"); return 0; #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: ai->oss.audio_fd = -1; ai->oss.device = strdup("/dev/dsp"); return 0; +#endif default: return -1; } @@ -50,10 +52,12 @@ ai->setup = 1; return 0; #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: if (ai_oss_init(ai) < 0) return -1; ai->setup = 1; return 0; +#endif default: return -1; } @@ -69,11 +73,13 @@ if (ai_alsa_setup(ai) < 0) return -1; return ai->samplerate; #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: ai->req_samplerate = rate; if (!ai->setup) return 0; if (ai_oss_set_samplerate(ai) < 0) return -1; return ai->samplerate; +#endif default: return -1; } @@ -89,11 +95,13 @@ if (ai_alsa_setup(ai) < 0) return -1; return ai->channels; #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: ai->req_channels = channels; if (!ai->setup) return 0; if (ai_oss_set_channels(ai) < 0) return -1; return ai->channels; +#endif default: return -1; } @@ -114,10 +122,12 @@ } return 0; #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: if (ai->oss.device) free(ai->oss.device); ai->oss.device = strdup(device); return 0; +#endif default: return -1; } @@ -137,10 +147,12 @@ ai->setup = 0; return 0; #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: close(ai->oss.audio_fd); ai->setup = 0; return 0; +#endif } } return -1; @@ -153,8 +165,10 @@ case AUDIO_IN_ALSA: return snd_pcm_start(ai->alsa.handle); #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: return 0; +#endif default: return -1; } @@ -185,6 +199,7 @@ } return ret; #endif +#ifdef USE_OSS_AUDIO case AUDIO_IN_OSS: ret = read(ai->oss.audio_fd, buffer, ai->blocksize); if (ret != ai->blocksize) { @@ -196,6 +211,7 @@ return -1; } return ret; +#endif default: return -1; }