forked from len0rd/rockbox
Another fix for crashing when changing crossfade settings
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11086 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
03aa9c9fea
commit
c9a78621af
1 changed files with 6 additions and 12 deletions
|
@ -625,10 +625,12 @@ void audio_set_crossfade(int enable)
|
||||||
gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK));
|
gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK));
|
||||||
LOGFQUEUE("audio > audio Q_AUDIO_STOP");
|
LOGFQUEUE("audio > audio Q_AUDIO_STOP");
|
||||||
queue_post(&audio_queue, Q_AUDIO_STOP, 0);
|
queue_post(&audio_queue, Q_AUDIO_STOP, 0);
|
||||||
while (audio_codec_loaded || playing)
|
while (audio_codec_loaded)
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
voice_stop();
|
||||||
|
|
||||||
/* Re-initialize audio system. */
|
/* Re-initialize audio system. */
|
||||||
pcmbuf_init(size);
|
pcmbuf_init(size);
|
||||||
pcmbuf_crossfade_enable(enable);
|
pcmbuf_crossfade_enable(enable);
|
||||||
|
@ -646,7 +648,7 @@ void audio_set_crossfade(int enable)
|
||||||
|
|
||||||
/* Wait for the playback to start again (and display the splash
|
/* Wait for the playback to start again (and display the splash
|
||||||
screen during that period. */
|
screen during that period. */
|
||||||
while (!playing && !audio_codec_loaded)
|
while (!playing)
|
||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -698,15 +700,7 @@ void voice_init(void)
|
||||||
return; /* Audio buffers not yet set up */
|
return; /* Audio buffers not yet set up */
|
||||||
|
|
||||||
if (voice_thread_p)
|
if (voice_thread_p)
|
||||||
{
|
return;
|
||||||
logf("Terminating voice codec");
|
|
||||||
remove_thread(voice_thread_p);
|
|
||||||
if (current_codec == CODEC_IDX_VOICE)
|
|
||||||
mutex_unlock(&mutex_codecthread);
|
|
||||||
queue_delete(&voice_queue);
|
|
||||||
voice_thread_p = NULL;
|
|
||||||
voice_codec_loaded = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!talk_voice_required())
|
if (!talk_voice_required())
|
||||||
return;
|
return;
|
||||||
|
@ -733,7 +727,7 @@ void voice_stop(void)
|
||||||
|
|
||||||
LOGFQUEUE("mp3 > voice Q_VOICE_STOP");
|
LOGFQUEUE("mp3 > voice Q_VOICE_STOP");
|
||||||
queue_post(&voice_queue, Q_VOICE_STOP, 0);
|
queue_post(&voice_queue, Q_VOICE_STOP, 0);
|
||||||
while (voice_is_playing && !queue_empty(&voice_queue))
|
while (voice_is_playing)
|
||||||
yield();
|
yield();
|
||||||
if (!playing)
|
if (!playing)
|
||||||
pcmbuf_play_stop();
|
pcmbuf_play_stop();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue