diff options
author | 2002-10-22 15:14:30 +0000 | |
---|---|---|
committer | 2002-10-22 15:14:30 +0000 | |
commit | 3d100efa4164d6634fcb394a8ab565607922c59a (patch) | |
tree | 87db7fc77dcc7984f193a159f1522f06ffd9c1ab | |
parent | dafa2d6507122fe429949fe5358a6fd3257ca3a8 (diff) |
OSS is optional (fixes case when "tv" enabled, and "ossaudio" disabled)
patch by Chad Netzer <cnetzer@sonic.net>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7844 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/audio_in.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libmpdemux/audio_in.c b/libmpdemux/audio_in.c index fbcb12c202..dbc8752be5 100644 --- a/libmpdemux/audio_in.c +++ b/libmpdemux/audio_in.c @@ -31,10 +31,12 @@ int audio_in_init(audio_in_t *ai, int type) 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 @@ int audio_in_setup(audio_in_t *ai) 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 @@ int audio_in_set_samplerate(audio_in_t *ai, int rate) 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 @@ int audio_in_set_channels(audio_in_t *ai, int channels) 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 @@ int audio_in_set_device(audio_in_t *ai, char *device) } 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 @@ int audio_in_uninit(audio_in_t *ai) 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 @@ int audio_in_start_capture(audio_in_t *ai) 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 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer) } 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 @@ int audio_in_read_chunk(audio_in_t *ai, unsigned char *buffer) return -1; } return ret; +#endif default: return -1; } |