]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Removed snd_pcm_hwdiff() function
authorJaroslav Kysela <perex@perex.cz>
Sat, 22 Feb 2003 17:53:01 +0000 (17:53 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sat, 22 Feb 2003 17:53:01 +0000 (17:53 +0000)
include/pcm.h
src/Versions
src/pcm/pcm.c
src/pcm/pcm_dmix.c
src/pcm/pcm_hw.c
src/pcm/pcm_local.h
src/pcm/pcm_plugin.c

index e2121886225f6aabe4589f80a24531da07402998..49279172116473a1aedb922b58cd07ceedf54f98 100644 (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);
index ea45321ae48d546ddb7d33e214deee47d570e192..b9dd740774b410572090815f44baea77588504e1 100644 (file)
@@ -83,7 +83,6 @@ ALSA_0.9.0rc4 {
 ALSA_0.9.0rc8 {
   global:
 
-    snd_pcm_hwdiff;
     snd_pcm_forward;
 
 } ALSA_0.9.0rc4;
index b53c43c76dd6e7fc3e5a249256938214047ec620..c4b31c39d5e9d0b3e761ba62a3c85072704b5b2d 100644 (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
index 588b30204bfc3d0707c6b7ae78872ee9bfd888bf..0dcfaac85e5562c553add08deea82f516f54ae30 100644 (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;
index ef27ea843e13474e87ad44508a841af92d9ee55c..a3a975078e2fbdbf1407c41b4214b87f90a48456 100644 (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;
index bc85ebc45fe5025f52e7513d0bf78f93fdc11c27..5873b1bdc9d44ae8bfd574d6e5ed0ec26ac6be4c 100644 (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);
index 51e56475f1defb42247a9ba589f9c56fa19d4eb0..ce7130551b3fad07ff04bce4fe766a0d41ba3543 100644 (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;
        }