mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-09 23:53:28 -04:00
pcm_mixer: fix active_channels handling in mixer_handle_sampr_change
`channel_stopped` compacts the `active_channels` array, so we should check the same index for the next active channel. Change-Id: I54c42f9b6c97f0c54d43b8faae0052e856f3c06d
This commit is contained in:
parent
958e84c042
commit
8d84986fc0
1 changed files with 13 additions and 6 deletions
|
|
@ -288,10 +288,11 @@ static void mixer_start_pcm(void)
|
|||
/* Notify users of samplerate change */
|
||||
static void mixer_handle_sampr_change(unsigned int sampr)
|
||||
{
|
||||
for (size_t i = 0; i < ARRAYLEN(active_channels) && active_channels[i]; i += 1)
|
||||
int i = 0;
|
||||
struct mixer_channel* chan;
|
||||
while ((chan = active_channels[i]))
|
||||
{
|
||||
struct mixer_channel* chan = active_channels[i];
|
||||
|
||||
bool stop_channel = true;
|
||||
/* Notify upstreams */
|
||||
if (chan->play_cbs)
|
||||
{
|
||||
|
|
@ -309,13 +310,19 @@ static void mixer_handle_sampr_change(unsigned int sampr)
|
|||
chan->start = start;
|
||||
chan->size = size;
|
||||
chan->last_size = 0;
|
||||
} else {
|
||||
channel_stopped(chan);
|
||||
|
||||
stop_channel = false;
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stop_channel)
|
||||
{
|
||||
channel_stopped(chan);
|
||||
}
|
||||
/* Notify buffer monitor */
|
||||
if (chan->buf_cbs)
|
||||
else if (chan->buf_cbs)
|
||||
{
|
||||
if (chan->buf_cbs->sampr_changed)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue