Removed snd_pcm_hwdiff() function

This commit is contained in:
Jaroslav Kysela 2003-02-22 17:53:01 +00:00
parent 2dab1dfbc3
commit 7b09000813
7 changed files with 4 additions and 51 deletions

View file

@ -410,7 +410,6 @@ int snd_pcm_drain(snd_pcm_t *pcm);
int snd_pcm_pause(snd_pcm_t *pcm, int enable);
snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm);
int snd_pcm_hwsync(snd_pcm_t *pcm);
int snd_pcm_hwdiff(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos);
int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp);
int snd_pcm_resume(snd_pcm_t *pcm);
snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm);

View file

@ -83,7 +83,6 @@ ALSA_0.9.0rc4 {
ALSA_0.9.0rc8 {
global:
snd_pcm_hwdiff;
snd_pcm_forward;
} ALSA_0.9.0rc4;

View file

@ -400,12 +400,6 @@ only when the stream is in the running or draining (playback only) state.
Note that this function does not update the current r/w pointer for applications,
so the function \link ::snd_pcm_avail_update \endlink must be called afterwards
before any read/write begin+commit operations.
<p>
To determine the processed frames by hardware, the function \link ::snd_pcm_hwdiff \endlink
might be used. Note that this function returns cached value which is synchronized with
hardware using the \link ::snd_pcm_hwsync \endlink function. The application may
manage the right r/w pointer via \link ::snd_pcm_rewind \endlink and
\link ::snd_pcm_forward \endlink functions.
\section pcm_action Managing the stream state
@ -874,44 +868,6 @@ int snd_pcm_hwsync(snd_pcm_t *pcm)
return pcm->fast_ops->hwsync(pcm->fast_op_arg);
}
/**
* \brief Return count of processed frames by hardware from last call
* \param pcm PCM handle
* \param diff Difference between last position and current
* \param old_pos Old position on entry, actual position on exit
* \return 0 on success otherwise a negative error code
*
* The old_ptr parameter is in range 0 ... (boundary - 1). It contains
* count_of_ring_buffer_crosses * buffer_size + offset in the ring buffer.
* Using this value is not intented
*
* Note this function does not obtain the real position from hardware.
* The function \link ::snd_pcm_hwsync \endlink have to be called
* before to obtain the real hardware position.
*/
#ifndef DOXYGEN
int INTERNAL(snd_pcm_hwdiff)(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos)
#else
int snd_pcm_hwdiff(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos)
#endif
{
snd_pcm_uframes_t d, hw_ptr;
assert(pcm && diff && old_pos);
assert(pcm->setup);
assert(*old_pos < pcm->boundary);
hw_ptr = *pcm->hw.ptr;
if (hw_ptr < *old_pos) {
d = (pcm->boundary - *old_pos) + hw_ptr;
} else {
d = hw_ptr - *old_pos;
}
*diff = d;
*old_pos = hw_ptr;
return 0;
}
default_symbol_version(__snd_pcm_hwdiff, snd_pcm_hwdiff, ALSA_0.9.0rc8);
/**
* \brief Obtain delay for a running PCM handle
* \param pcm PCM handle

View file

@ -1096,7 +1096,7 @@ static snd_pcm_sframes_t snd_pcm_dmix_forward(snd_pcm_t *pcm, snd_pcm_uframes_t
avail = snd_pcm_mmap_avail(pcm);
if (avail < 0)
return 0;
if (frames > avail)
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
return frames;

View file

@ -533,7 +533,7 @@ static snd_pcm_sframes_t snd_pcm_hw_forward(snd_pcm_t *pcm, snd_pcm_uframes_t fr
avail = snd_pcm_mmap_avail(pcm);
if (avail < 0)
return 0;
if (frames > avail)
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
return frames;
@ -715,7 +715,7 @@ static int snd_pcm_hw_close(snd_pcm_t *pcm)
}
static snd_pcm_sframes_t snd_pcm_hw_mmap_commit(snd_pcm_t *pcm,
snd_pcm_uframes_t offset,
snd_pcm_uframes_t offset ATTRIBUTE_UNUSED,
snd_pcm_uframes_t size)
{
snd_pcm_hw_t *hw = pcm->private_data;

View file

@ -550,7 +550,6 @@ int snd_pcm_hw_param_get_max(const snd_pcm_hw_params_t *params,
unsigned int *val, int *dir);
#ifdef INTERNAL
int INTERNAL(snd_pcm_hwdiff)(snd_pcm_t *pcm, snd_pcm_uframes_t *diff, snd_pcm_uframes_t *old_pos);
snd_pcm_sframes_t INTERNAL(snd_pcm_forward)(snd_pcm_t *pcm, snd_pcm_uframes_t frames);
int INTERNAL(snd_pcm_hw_params_get_access)(const snd_pcm_hw_params_t *params, snd_pcm_access_t *access);

View file

@ -325,7 +325,7 @@ snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frame
sframes = frames;
snd_atomic_write_begin(&plugin->watom);
sframes = snd_pcm_forward(plugin->slave, (snd_pcm_uframes_t) sframes);
if (sframes < 0) {
if ((snd_pcm_sframes_t) sframes < 0) {
snd_atomic_write_end(&plugin->watom);
return sframes;
}