mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									ba9332e919
								
							
						
					
					
						commit
						ade3efbd86
					
				
					 2 changed files with 4 additions and 31 deletions
				
			
		| 
						 | 
					@ -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);
 | 
						int err = snd_pcm_delay(plugin->gen.slave, &sd);
 | 
				
			||||||
	if (err < 0)
 | 
						if (err < 0)
 | 
				
			||||||
		return err;
 | 
							return err;
 | 
				
			||||||
	if (plugin->client_frames)
 | 
					 | 
				
			||||||
		sd = plugin->client_frames(pcm, sd);
 | 
					 | 
				
			||||||
	*delayp = sd;
 | 
						*delayp = sd;
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -208,9 +206,6 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
 | 
				
			||||||
	if (frames == 0)
 | 
						if (frames == 0)
 | 
				
			||||||
		return 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);
 | 
						snd_atomic_write_begin(&plugin->watom);
 | 
				
			||||||
	sframes = snd_pcm_rewind(plugin->gen.slave, sframes);
 | 
						sframes = snd_pcm_rewind(plugin->gen.slave, sframes);
 | 
				
			||||||
| 
						 | 
					@ -218,8 +213,6 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t
 | 
				
			||||||
		snd_atomic_write_end(&plugin->watom);
 | 
							snd_atomic_write_end(&plugin->watom);
 | 
				
			||||||
		return sframes;
 | 
							return sframes;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (plugin->client_frames)
 | 
					 | 
				
			||||||
		frames = plugin->client_frames(pcm, sframes);
 | 
					 | 
				
			||||||
	snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
 | 
						snd_pcm_mmap_appl_backward(pcm, (snd_pcm_uframes_t) frames);
 | 
				
			||||||
	snd_atomic_write_end(&plugin->watom);
 | 
						snd_atomic_write_end(&plugin->watom);
 | 
				
			||||||
	return (snd_pcm_sframes_t) frames;
 | 
						return (snd_pcm_sframes_t) frames;
 | 
				
			||||||
| 
						 | 
					@ -241,9 +234,6 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
 | 
				
			||||||
	if (frames == 0)
 | 
						if (frames == 0)
 | 
				
			||||||
		return 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);
 | 
						snd_atomic_write_begin(&plugin->watom);
 | 
				
			||||||
	sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
 | 
						sframes = INTERNAL(snd_pcm_forward)(plugin->gen.slave, sframes);
 | 
				
			||||||
| 
						 | 
					@ -251,8 +241,6 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_
 | 
				
			||||||
		snd_atomic_write_end(&plugin->watom);
 | 
							snd_atomic_write_end(&plugin->watom);
 | 
				
			||||||
		return sframes;
 | 
							return sframes;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (plugin->client_frames)
 | 
					 | 
				
			||||||
		frames = plugin->client_frames(pcm, sframes);
 | 
					 | 
				
			||||||
	snd_pcm_mmap_appl_forward(pcm, (snd_pcm_uframes_t) frames);
 | 
						snd_pcm_mmap_appl_forward(pcm, (snd_pcm_uframes_t) frames);
 | 
				
			||||||
	snd_atomic_write_end(&plugin->watom);
 | 
						snd_atomic_write_end(&plugin->watom);
 | 
				
			||||||
	return (snd_pcm_sframes_t) frames;
 | 
						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_INTERLEAVED &&
 | 
				
			||||||
	    pcm->access != SND_PCM_ACCESS_RW_NONINTERLEAVED)
 | 
						    pcm->access != SND_PCM_ACCESS_RW_NONINTERLEAVED)
 | 
				
			||||||
		goto _capture;
 | 
							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;
 | 
					        *pcm->hw.ptr = *slave->hw.ptr;
 | 
				
			||||||
        return slave_size;
 | 
					        return slave_size;
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 _capture:
 | 
					 _capture:
 | 
				
			||||||
 	{
 | 
					 	{
 | 
				
			||||||
		const snd_pcm_channel_area_t *areas;
 | 
							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->appl_ptr = *pcm->appl.ptr;
 | 
				
			||||||
	status->hw_ptr = *pcm->hw.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)) {
 | 
						if (!snd_atomic_read_ok(&ratom)) {
 | 
				
			||||||
		snd_atomic_read_wait(&ratom);
 | 
							snd_atomic_read_wait(&ratom);
 | 
				
			||||||
		goto _again;
 | 
							goto _again;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (plugin->client_frames)
 | 
					 | 
				
			||||||
		status->avail_max = plugin->client_frames(pcm, (snd_pcm_sframes_t) status->avail_max);
 | 
					 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -44,8 +44,6 @@ typedef struct {
 | 
				
			||||||
	snd_pcm_slave_xfer_areas_func_t write;
 | 
						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_read;
 | 
				
			||||||
	snd_pcm_slave_xfer_areas_undo_func_t undo_write;
 | 
						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);
 | 
						int (*init)(snd_pcm_t *pcm);
 | 
				
			||||||
	snd_pcm_uframes_t appl_ptr, hw_ptr;
 | 
						snd_pcm_uframes_t appl_ptr, hw_ptr;
 | 
				
			||||||
	snd_atomic_write_t watom;
 | 
						snd_atomic_write_t watom;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue