summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/apps/playback.c b/apps/playback.c
index db47b0be6f..b68a8b81f1 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -324,14 +324,6 @@ void mp3_play_stop(void)
324{ 324{
325#ifdef PLAYBACK_VOICE 325#ifdef PLAYBACK_VOICE
326 LOGFQUEUE("mp3 > voice Q_VOICE_STOP"); 326 LOGFQUEUE("mp3 > voice Q_VOICE_STOP");
327 queue_post(&voice_queue, Q_VOICE_STOP, 0);
328#endif
329}
330
331void mp3_play_abort(void)
332{
333#ifdef PLAYBACK_VOICE
334 LOGFQUEUE("mp3 > voice Q_VOICE_STOP");
335 queue_post(&voice_queue, Q_VOICE_STOP, (void *)1); 327 queue_post(&voice_queue, Q_VOICE_STOP, (void *)1);
336#endif 328#endif
337} 329}
@@ -445,6 +437,15 @@ bool audio_has_changed_track(void)
445void audio_play(long offset) 437void audio_play(long offset)
446{ 438{
447 logf("audio_play"); 439 logf("audio_play");
440
441#ifdef PLAYBACK_VOICE
442 /* Truncate any existing voice output so we don't have spelling
443 * etc. over the first part of the played track */
444 LOGFQUEUE("mp3 > voice Q_VOICE_STOP");
445 queue_post(&voice_queue, Q_VOICE_STOP, (void *)1);
446#endif
447
448 /* Start playback */
448 if (playing && offset <= 0) 449 if (playing && offset <= 0)
449 { 450 {
450 LOGFQUEUE("audio > audio Q_AUDIO_NEW_PLAYLIST"); 451 LOGFQUEUE("audio > audio Q_AUDIO_NEW_PLAYLIST");
@@ -457,14 +458,19 @@ void audio_play(long offset)
457 LOGFQUEUE("audio > audio Q_AUDIO_PLAY"); 458 LOGFQUEUE("audio > audio Q_AUDIO_PLAY");
458 queue_post(&audio_queue, Q_AUDIO_PLAY, (void *)offset); 459 queue_post(&audio_queue, Q_AUDIO_PLAY, (void *)offset);
459 } 460 }
461
462 /* Don't return until playback has actually started */
460 while (!playing) 463 while (!playing)
461 yield(); 464 yield();
462} 465}
463 466
464void audio_stop(void) 467void audio_stop(void)
465{ 468{
469 /* Stop playback */
466 LOGFQUEUE("audio > audio Q_AUDIO_STOP"); 470 LOGFQUEUE("audio > audio Q_AUDIO_STOP");
467 queue_post(&audio_queue, Q_AUDIO_STOP, 0); 471 queue_post(&audio_queue, Q_AUDIO_STOP, 0);
472
473 /* Don't return until playback has actually stopped */
468 while(playing) 474 while(playing)
469 yield(); 475 yield();
470} 476}