alsa/0034-pcm_plugin-remove-unused-client_frames-and-slave_fra.patch

120 lines
4.1 KiB
Diff

From ade3efbd865967bf78d7f0ae6a2fe9809ea90719 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Date: Fri, 19 Nov 2010 10:35:31 -0600
Subject: [PATCH 08/10] pcm_plugin: remove unused client_frames and slave_frames routines
plug->client_frames and plug->slave_frames are not used by
any plugin, remove dead code.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_plugin.c | 33 ++++-----------------------------
src/pcm/pcm_plugin.h | 2 --
2 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
index 0ef394a..19d0dee 100644
--- a/src/pcm/pcm_plugin.c
+++ b/src/pcm/pcm_plugin.c
@@ -144,8 +144,6 @@ static int snd_pcm_plugin_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
int err = snd_pcm_delay(plugin->gen.slave, &sd);
if (err < 0)
return err;
- if (plugin->client_frames)
- sd = plugin->client_frames(pcm, sd);
*delayp = sd;
return 0;
}
@@ -208,18 +206,13 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
if (frames == 0)
return 0;
- if (plugin->slave_frames)
- sframes = plugin->slave_frames(pcm, (snd_pcm_sframes_t) frames);
- else
- sframes = frames;
+ sframes = frames;
snd_atomic_write_begin(&plugin->watom);
sframes = snd_pcm_rewind(plugin->gen.slave, sframes);
if (sframes < 0) {
snd_atomic_write_end(&plugin->watom);
return sframes;
}
- if (plugin->client_frames)
- frames = plugin->client_frames(pcm, sframes);
snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
snd_atomic_write_end(&plugin->watom);
return (snd_pcm_sframes_t) frames;
@@ -241,18 +234,13 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
if (frames == 0)
return 0;
- if (plugin->slave_frames)
- sframes = plugin->slave_frames(pcm, (snd_pcm_sframes_t) frames);
- else
- sframes = frames;
+ sframes = frames;
snd_atomic_write_begin(&plugin->watom);
sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
if (sframes < 0) {
snd_atomic_write_end(&plugin->watom);
return sframes;
}
- if (plugin->client_frames)
- frames = plugin->client_frames(pcm, sframes);
snd_pcm_mmap_appl_forward(pcm, (snd_pcm_uframes_t) frames);
snd_atomic_write_end(&plugin->watom);
return (snd_pcm_sframes_t) frames;
@@ -469,15 +457,8 @@ static snd_pcm_sframes_t snd_pcm_plugin_avail_update(snd_pcm_t *pcm)
pcm->access != SND_PCM_ACCESS_RW_INTERLEAVED &&
pcm->access != SND_PCM_ACCESS_RW_NONINTERLEAVED)
goto _capture;
- if (plugin->client_frames) {
- *pcm->hw.ptr = plugin->client_frames(pcm, *slave->hw.ptr);
- if (slave_size <= 0)
- return slave_size;
- return plugin->client_frames(pcm, slave_size);
- } else {
- *pcm->hw.ptr = *slave->hw.ptr;
- return slave_size;
- }
+ *pcm->hw.ptr = *slave->hw.ptr;
+ return slave_size;
_capture:
{
const snd_pcm_channel_area_t *areas;
@@ -547,16 +528,10 @@ static int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
}
status->appl_ptr = *pcm->appl.ptr;
status->hw_ptr = *pcm->hw.ptr;
- if (plugin->client_frames) {
- status->delay = plugin->client_frames(pcm, status->delay);
- status->avail = plugin->client_frames(pcm, status->avail);
- }
if (!snd_atomic_read_ok(&ratom)) {
snd_atomic_read_wait(&ratom);
goto _again;
}
- if (plugin->client_frames)
- status->avail_max = plugin->client_frames(pcm, (snd_pcm_sframes_t) status->avail_max);
return 0;
}
diff --git a/src/pcm/pcm_plugin.h b/src/pcm/pcm_plugin.h
index dfcf6de..7ee7c7f 100644
--- a/src/pcm/pcm_plugin.h
+++ b/src/pcm/pcm_plugin.h
@@ -44,8 +44,6 @@ typedef struct {
snd_pcm_slave_xfer_areas_func_t write;
snd_pcm_slave_xfer_areas_undo_func_t undo_read;
snd_pcm_slave_xfer_areas_undo_func_t undo_write;
- snd_pcm_sframes_t (*client_frames)(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
- snd_pcm_sframes_t (*slave_frames)(snd_pcm_t *pcm, snd_pcm_sframes_t frames);
int (*init)(snd_pcm_t *pcm);
snd_pcm_uframes_t appl_ptr, hw_ptr;
snd_atomic_write_t watom;
--
1.7.3.1