mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-11 13:30:05 -05:00
Abramo Bagnara <abramo@alsa-project.org>
Sat, 11 Dec 1999 08:45:24 +0100 - changed lowlevel drivers to use pcm_misc.c functions - fixed some bugs in pcm_plugin_build - the plugin code is shared between alsa-lib and alsa-driver
This commit is contained in:
parent
0f0ce09509
commit
20ebae20a7
13 changed files with 596 additions and 508 deletions
|
|
@ -21,6 +21,11 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include "../../include/driver.h"
|
||||
#include "../../include/pcm_plugin.h"
|
||||
#define bswap_16(x) __swab16((x))
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -29,6 +34,7 @@
|
|||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
#include "../pcm_local.h"
|
||||
#endif
|
||||
|
||||
#define SIGN_BIT (0x80) /* Sign bit for a u-law byte. */
|
||||
#define QUANT_MASK (0xf) /* Quantization field mask. */
|
||||
|
|
@ -241,8 +247,8 @@ static void mulaw_conv_mulaw_swap_u16bit(unsigned char *src_ptr, unsigned short
|
|||
}
|
||||
|
||||
static ssize_t mulaw_transfer(snd_pcm_plugin_t *plugin,
|
||||
char *src_ptr, size_t src_size,
|
||||
char *dst_ptr, size_t dst_size)
|
||||
char *src_ptr, size_t src_size,
|
||||
char *dst_ptr, size_t dst_size)
|
||||
{
|
||||
struct mulaw_private_data *data;
|
||||
|
||||
|
|
@ -436,7 +442,8 @@ int snd_pcm_plugin_build_mulaw(snd_pcm_format_t *src_format,
|
|||
return -EINVAL;
|
||||
*r_plugin = NULL;
|
||||
|
||||
if (src_format->interleave != dst_format->interleave)
|
||||
if (src_format->interleave != dst_format->interleave &&
|
||||
src_format->voices > 1)
|
||||
return -EINVAL;
|
||||
if (src_format->rate != dst_format->rate)
|
||||
return -EINVAL;
|
||||
|
|
@ -480,3 +487,7 @@ int snd_pcm_plugin_build_mulaw(snd_pcm_format_t *src_format,
|
|||
*r_plugin = plugin;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __KERNEL__
|
||||
EXPORT_SYMBOL(snd_pcm_plugin_build_mulaw);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue