mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-11 13:30:05 -05:00
64-bit fixes.
Controls API uses binary tree functions (tsearch ...).
This commit is contained in:
parent
e22a79b707
commit
f981892e3a
13 changed files with 174 additions and 164 deletions
|
|
@ -139,7 +139,7 @@ int snd_pcm_state(snd_pcm_t *handle)
|
|||
return handle->fast_ops->state(handle->fast_op_arg);
|
||||
}
|
||||
|
||||
int snd_pcm_frame_io(snd_pcm_t *handle, int update)
|
||||
ssize_t snd_pcm_frame_io(snd_pcm_t *handle, int update)
|
||||
{
|
||||
assert(handle);
|
||||
assert(handle->valid_setup);
|
||||
|
|
@ -428,16 +428,16 @@ int snd_pcm_dump_setup(snd_pcm_t *handle, FILE *fp)
|
|||
fprintf(fp, "xrun_mode: %s\n", assoc(setup->xrun_mode, xruns));
|
||||
fprintf(fp, "time: %s\n", assoc(setup->time, onoff));
|
||||
// ust_time
|
||||
fprintf(fp, "buffer_size: %d\n", setup->buffer_size);
|
||||
fprintf(fp, "frag_size: %d\n", setup->frag_size);
|
||||
fprintf(fp, "frags: %d\n", setup->frags);
|
||||
fprintf(fp, "frame_boundary: %d\n", setup->frame_boundary);
|
||||
fprintf(fp, "buffer_size: %ld\n", (long)setup->buffer_size);
|
||||
fprintf(fp, "frag_size: %ld\n", (long)setup->frag_size);
|
||||
fprintf(fp, "frags: %ld\n", (long)setup->frags);
|
||||
fprintf(fp, "frame_boundary: %ld\n", (long)setup->frame_boundary);
|
||||
fprintf(fp, "msbits_per_sample: %d\n", setup->msbits_per_sample);
|
||||
fprintf(fp, "frames_min: %d\n", setup->frames_min);
|
||||
fprintf(fp, "frames_align: %d\n", setup->frames_align);
|
||||
fprintf(fp, "frames_xrun_max: %d\n", setup->frames_xrun_max);
|
||||
fprintf(fp, "frames_min: %ld\n", (long)setup->frames_min);
|
||||
fprintf(fp, "frames_align: %ld\n", (long)setup->frames_align);
|
||||
fprintf(fp, "frames_xrun_max: %ld\n", (long)setup->frames_xrun_max);
|
||||
fprintf(fp, "fill_mode: %s\n", assoc(setup->fill_mode, fills));
|
||||
fprintf(fp, "frames_fill_max: %d\n", setup->frames_fill_max);
|
||||
fprintf(fp, "frames_fill_max: %ld\n", (long)setup->frames_fill_max);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -473,28 +473,28 @@ int snd_pcm_format_value(const char* name)
|
|||
return -1;
|
||||
}
|
||||
|
||||
ssize_t snd_pcm_bytes_to_frames(snd_pcm_t *handle, int bytes)
|
||||
ssize_t snd_pcm_bytes_to_frames(snd_pcm_t *handle, ssize_t bytes)
|
||||
{
|
||||
assert(handle);
|
||||
assert(handle->valid_setup);
|
||||
return bytes * 8 / handle->bits_per_frame;
|
||||
}
|
||||
|
||||
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *handle, int frames)
|
||||
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *handle, ssize_t frames)
|
||||
{
|
||||
assert(handle);
|
||||
assert(handle->valid_setup);
|
||||
return frames * handle->bits_per_frame / 8;
|
||||
}
|
||||
|
||||
ssize_t snd_pcm_bytes_to_samples(snd_pcm_t *handle, int bytes)
|
||||
ssize_t snd_pcm_bytes_to_samples(snd_pcm_t *handle, ssize_t bytes)
|
||||
{
|
||||
assert(handle);
|
||||
assert(handle->valid_setup);
|
||||
return bytes * 8 / handle->bits_per_sample;
|
||||
}
|
||||
|
||||
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *handle, int samples)
|
||||
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *handle, ssize_t samples)
|
||||
{
|
||||
assert(handle);
|
||||
assert(handle->valid_setup);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static int snd_pcm_hw_status(void *private, snd_pcm_status_t * status)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t snd_pcm_hw_state(void *private)
|
||||
static int snd_pcm_hw_state(void *private)
|
||||
{
|
||||
snd_pcm_hw_t *hw = (snd_pcm_hw_t*) private;
|
||||
int fd = hw->fd;
|
||||
|
|
|
|||
|
|
@ -111,9 +111,9 @@ int snd_pcm_plug_playback_channels_mask(snd_pcm_plug_t *plug,
|
|||
bitset_t *client_vmask);
|
||||
int snd_pcm_plug_capture_channels_mask(snd_pcm_plug_t *plug,
|
||||
bitset_t *client_vmask);
|
||||
int snd_pcm_plugin_client_channels(snd_pcm_plugin_t *plugin,
|
||||
size_t frames,
|
||||
snd_pcm_plugin_channel_t **channels);
|
||||
ssize_t snd_pcm_plugin_client_channels(snd_pcm_plugin_t *plugin,
|
||||
size_t frames,
|
||||
snd_pcm_plugin_channel_t **channels);
|
||||
|
||||
void *snd_pcm_plug_buf_alloc(snd_pcm_plug_t *plug, size_t size);
|
||||
void snd_pcm_plug_buf_unlock(snd_pcm_plug_t *pcm, void *ptr);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/poll.h>
|
||||
#include <sys/uio.h>
|
||||
|
|
@ -118,7 +119,7 @@ int snd_pcm_mmap_state(snd_pcm_t *handle)
|
|||
return handle->mmap_status->state;
|
||||
}
|
||||
|
||||
int snd_pcm_mmap_frame_io(snd_pcm_t *handle)
|
||||
ssize_t snd_pcm_mmap_frame_io(snd_pcm_t *handle)
|
||||
{
|
||||
assert(handle);
|
||||
assert(handle->mmap_status);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ int snd_pcm_plugin_append(snd_pcm_plugin_t *plugin)
|
|||
void snd_pcm_plugin_dump(snd_pcm_plugin_t *plugin, FILE *fp)
|
||||
{
|
||||
fprintf(fp, "----------- %s\n", plugin->name);
|
||||
fprintf(fp, "Buffer: %d frames\n", plugin->buf_frames);
|
||||
fprintf(fp, "Buffer: %ld frames\n", (long)plugin->buf_frames);
|
||||
if (plugin->src_format.interleave != plugin->dst_format.interleave) {
|
||||
if (plugin->src_format.interleave)
|
||||
fprintf(fp, "Interleaved -> Non interleaved\n");
|
||||
|
|
@ -314,7 +314,7 @@ static int snd_pcm_plug_state(void *private)
|
|||
return snd_pcm_state(plug->slave);
|
||||
}
|
||||
|
||||
static int snd_pcm_plug_frame_io(void *private, int update)
|
||||
static ssize_t snd_pcm_plug_frame_io(void *private, int update)
|
||||
{
|
||||
snd_pcm_plug_t *plug = (snd_pcm_plug_t*) private;
|
||||
ssize_t frame_io = snd_pcm_frame_io(plug->slave, update);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue