diff options
Diffstat (limited to 'apps/codec_thread.c')
-rw-r--r-- | apps/codec_thread.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c index e3f190e69c..acb0a5d646 100644 --- a/apps/codec_thread.c +++ b/apps/codec_thread.c | |||
@@ -262,7 +262,7 @@ static size_t codec_filebuf_callback(void *ptr, size_t size) | |||
262 | { | 262 | { |
263 | ssize_t copy_n; | 263 | ssize_t copy_n; |
264 | 264 | ||
265 | if (ci.stop_codec || !audio_is_playing()) | 265 | if (ci.stop_codec || !(audio_status() & AUDIO_STATUS_PLAY)) |
266 | return 0; | 266 | return 0; |
267 | 267 | ||
268 | copy_n = bufread(get_audio_hid(), size, ptr); | 268 | copy_n = bufread(get_audio_hid(), size, ptr); |
@@ -284,7 +284,7 @@ static void* codec_request_buffer_callback(size_t *realsize, size_t reqsize) | |||
284 | ssize_t ret; | 284 | ssize_t ret; |
285 | void *ptr; | 285 | void *ptr; |
286 | 286 | ||
287 | if (!audio_is_playing()) | 287 | if (!(audio_status() & AUDIO_STATUS_PLAY)) |
288 | { | 288 | { |
289 | *realsize = 0; | 289 | *realsize = 0; |
290 | return NULL; | 290 | return NULL; |
@@ -335,16 +335,17 @@ static void codec_seek_complete_callback(void) | |||
335 | { | 335 | { |
336 | logf("seek_complete"); | 336 | logf("seek_complete"); |
337 | /* If seeking-while-playing, pcm_is_paused() is true. | 337 | /* If seeking-while-playing, pcm_is_paused() is true. |
338 | * If seeking-while-paused, audio_is_paused() is true. | 338 | * If seeking-while-paused, audio_status PAUSE is true. |
339 | * A seamless seek skips this section. */ | 339 | * A seamless seek skips this section. */ |
340 | if (pcm_is_paused() || audio_is_paused()) | 340 | bool audio_paused = audio_status() & AUDIO_STATUS_PAUSE; |
341 | if (pcm_is_paused() || audio_paused) | ||
341 | { | 342 | { |
342 | /* Clear the buffer */ | 343 | /* Clear the buffer */ |
343 | pcmbuf_play_stop(); | 344 | pcmbuf_play_stop(); |
344 | dsp_configure(ci.dsp, DSP_FLUSH, 0); | 345 | dsp_configure(ci.dsp, DSP_FLUSH, 0); |
345 | 346 | ||
346 | /* If seeking-while-playing, resume pcm playback */ | 347 | /* If seeking-while-playing, resume pcm playback */ |
347 | if (!audio_is_paused()) | 348 | if (!audio_paused) |
348 | pcmbuf_pause(false); | 349 | pcmbuf_pause(false); |
349 | } | 350 | } |
350 | ci.seek_time = 0; | 351 | ci.seek_time = 0; |
@@ -364,7 +365,7 @@ static bool codec_request_next_track_callback(void) | |||
364 | { | 365 | { |
365 | int prev_codectype; | 366 | int prev_codectype; |
366 | 367 | ||
367 | if (ci.stop_codec || !audio_is_playing()) | 368 | if (ci.stop_codec || !(audio_status() & AUDIO_STATUS_PLAY)) |
368 | return false; | 369 | return false; |
369 | 370 | ||
370 | prev_codectype = get_codec_base_type(thistrack_id3->codectype); | 371 | prev_codectype = get_codec_base_type(thistrack_id3->codectype); |
@@ -542,7 +543,7 @@ static void codec_thread(void) | |||
542 | if (ci.stop_codec) | 543 | if (ci.stop_codec) |
543 | { | 544 | { |
544 | status = CODEC_OK; | 545 | status = CODEC_OK; |
545 | if (!audio_is_playing()) | 546 | if (!(audio_status() & AUDIO_STATUS_PLAY)) |
546 | pcmbuf_play_stop(); | 547 | pcmbuf_play_stop(); |
547 | 548 | ||
548 | } | 549 | } |
@@ -553,7 +554,7 @@ static void codec_thread(void) | |||
553 | case Q_CODEC_LOAD_DISK: | 554 | case Q_CODEC_LOAD_DISK: |
554 | case Q_CODEC_LOAD: | 555 | case Q_CODEC_LOAD: |
555 | LOGFQUEUE("codec < Q_CODEC_LOAD"); | 556 | LOGFQUEUE("codec < Q_CODEC_LOAD"); |
556 | if (audio_is_playing()) | 557 | if (audio_status() & AUDIO_STATUS_PLAY) |
557 | { | 558 | { |
558 | if (ci.new_track || status != CODEC_OK) | 559 | if (ci.new_track || status != CODEC_OK) |
559 | { | 560 | { |