mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Use buflib for the allocation of voice PCM resources.
Buffers are not allocated and thread is not created until the first call where voice is required. Adds a different callback (sync_callback) to buflib so that other sorts of synchonization are possible, such as briefly locking-out the PCM callback for a buffer move. It's sort of a messy addition but it is needed so voice decoding won't have to be stopped when its buffer is moved. Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
This commit is contained in:
parent
3d3a144cf6
commit
da6cebb6b0
13 changed files with 244 additions and 132 deletions
|
@ -406,6 +406,16 @@ void mixer_channel_calculate_peaks(enum pcm_mixer_channel channel,
|
|||
*right = peaks->val[1];
|
||||
}
|
||||
|
||||
/* Adjust channel pointer by a given offset to support movable buffers */
|
||||
void mixer_adjust_channel_address(enum pcm_mixer_channel channel,
|
||||
off_t offset)
|
||||
{
|
||||
pcm_play_lock();
|
||||
/* Makes no difference if it's stopped */
|
||||
channels[channel].start += offset;
|
||||
pcm_play_unlock();
|
||||
}
|
||||
|
||||
/* Stop ALL channels and PCM and reset state */
|
||||
void mixer_reset(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue