summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/playback.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 5996886d7e..b80cee7486 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -625,10 +625,12 @@ void audio_set_crossfade(int enable)
625 gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK)); 625 gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK));
626 LOGFQUEUE("audio > audio Q_AUDIO_STOP"); 626 LOGFQUEUE("audio > audio Q_AUDIO_STOP");
627 queue_post(&audio_queue, Q_AUDIO_STOP, 0); 627 queue_post(&audio_queue, Q_AUDIO_STOP, 0);
628 while (audio_codec_loaded || playing) 628 while (audio_codec_loaded)
629 yield(); 629 yield();
630 } 630 }
631 631
632 voice_stop();
633
632 /* Re-initialize audio system. */ 634 /* Re-initialize audio system. */
633 pcmbuf_init(size); 635 pcmbuf_init(size);
634 pcmbuf_crossfade_enable(enable); 636 pcmbuf_crossfade_enable(enable);
@@ -646,7 +648,7 @@ void audio_set_crossfade(int enable)
646 648
647 /* Wait for the playback to start again (and display the splash 649 /* Wait for the playback to start again (and display the splash
648 screen during that period. */ 650 screen during that period. */
649 while (!playing && !audio_codec_loaded) 651 while (!playing)
650 yield(); 652 yield();
651 } 653 }
652} 654}
@@ -698,15 +700,7 @@ void voice_init(void)
698 return; /* Audio buffers not yet set up */ 700 return; /* Audio buffers not yet set up */
699 701
700 if (voice_thread_p) 702 if (voice_thread_p)
701 { 703 return;
702 logf("Terminating voice codec");
703 remove_thread(voice_thread_p);
704 if (current_codec == CODEC_IDX_VOICE)
705 mutex_unlock(&mutex_codecthread);
706 queue_delete(&voice_queue);
707 voice_thread_p = NULL;
708 voice_codec_loaded = false;
709 }
710 704
711 if (!talk_voice_required()) 705 if (!talk_voice_required())
712 return; 706 return;
@@ -733,7 +727,7 @@ void voice_stop(void)
733 727
734 LOGFQUEUE("mp3 > voice Q_VOICE_STOP"); 728 LOGFQUEUE("mp3 > voice Q_VOICE_STOP");
735 queue_post(&voice_queue, Q_VOICE_STOP, 0); 729 queue_post(&voice_queue, Q_VOICE_STOP, 0);
736 while (voice_is_playing && !queue_empty(&voice_queue)) 730 while (voice_is_playing)
737 yield(); 731 yield();
738 if (!playing) 732 if (!playing)
739 pcmbuf_play_stop(); 733 pcmbuf_play_stop();