diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /sound/core/oss/mulaw.c | |
parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) |
Merge branch 'linus'
Diffstat (limited to 'sound/core/oss/mulaw.c')
-rw-r--r-- | sound/core/oss/mulaw.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/core/oss/mulaw.c b/sound/core/oss/mulaw.c index 14f5578ec7a7..2eb18807e6d0 100644 --- a/sound/core/oss/mulaw.c +++ b/sound/core/oss/mulaw.c | |||
@@ -22,6 +22,9 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <sound/driver.h> | 24 | #include <sound/driver.h> |
25 | |||
26 | #ifdef CONFIG_SND_PCM_OSS_PLUGINS | ||
27 | |||
25 | #include <linux/time.h> | 28 | #include <linux/time.h> |
26 | #include <sound/core.h> | 29 | #include <sound/core.h> |
27 | #include <sound/pcm.h> | 30 | #include <sound/pcm.h> |
@@ -262,6 +265,25 @@ static snd_pcm_sframes_t mulaw_transfer(struct snd_pcm_plugin *plugin, | |||
262 | return frames; | 265 | return frames; |
263 | } | 266 | } |
264 | 267 | ||
268 | static int getput_index(int format) | ||
269 | { | ||
270 | int sign, width, endian; | ||
271 | sign = !snd_pcm_format_signed(format); | ||
272 | width = snd_pcm_format_width(format) / 8 - 1; | ||
273 | if (width < 0 || width > 3) { | ||
274 | snd_printk(KERN_ERR "snd-pcm-oss: invalid format %d\n", format); | ||
275 | width = 0; | ||
276 | } | ||
277 | #ifdef SNDRV_LITTLE_ENDIAN | ||
278 | endian = snd_pcm_format_big_endian(format); | ||
279 | #else | ||
280 | endian = snd_pcm_format_little_endian(format); | ||
281 | #endif | ||
282 | if (endian < 0) | ||
283 | endian = 0; | ||
284 | return width * 4 + endian * 2 + sign; | ||
285 | } | ||
286 | |||
265 | int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug, | 287 | int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug, |
266 | struct snd_pcm_plugin_format *src_format, | 288 | struct snd_pcm_plugin_format *src_format, |
267 | struct snd_pcm_plugin_format *dst_format, | 289 | struct snd_pcm_plugin_format *dst_format, |
@@ -306,3 +328,5 @@ int snd_pcm_plugin_build_mulaw(struct snd_pcm_substream *plug, | |||
306 | *r_plugin = plugin; | 328 | *r_plugin = plugin; |
307 | return 0; | 329 | return 0; |
308 | } | 330 | } |
331 | |||
332 | #endif | ||