summaryrefslogtreecommitdiff
path: root/apps/codec_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codec_thread.c')
-rw-r--r--apps/codec_thread.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/codec_thread.c b/apps/codec_thread.c
index 945f0b0605..199bb0e742 100644
--- a/apps/codec_thread.c
+++ b/apps/codec_thread.c
@@ -77,9 +77,10 @@ struct codec_load_info
77static int codec_type = AFMT_UNKNOWN; /* Codec type (C,A-) */ 77static int codec_type = AFMT_UNKNOWN; /* Codec type (C,A-) */
78 78
79/* Private interfaces to main playback control */ 79/* Private interfaces to main playback control */
80extern void audio_codec_update_elapsed(unsigned long value); 80extern void audio_codec_update_elapsed(unsigned long elapsed);
81extern void audio_codec_update_offset(size_t value); 81extern void audio_codec_update_offset(size_t offset);
82extern void audio_queue_post(long id, intptr_t data); 82extern void audio_codec_complete(int status);
83extern void audio_codec_seek_complete(void);
83extern struct codec_api ci; /* from codecs.c */ 84extern struct codec_api ci; /* from codecs.c */
84 85
85/* Codec thread */ 86/* Codec thread */
@@ -251,7 +252,7 @@ static void codec_pcmbuf_insert_callback(
251 if (out_count <= 0) 252 if (out_count <= 0)
252 return; 253 return;
253 254
254 pcmbuf_write_complete(out_count); 255 pcmbuf_write_complete(out_count, ci.id3->elapsed, ci.id3->offset);
255 256
256 count -= inp_count; 257 count -= inp_count;
257 } 258 }
@@ -334,9 +335,11 @@ static void codec_seek_complete_callback(void)
334 /* Clear DSP */ 335 /* Clear DSP */
335 dsp_configure(ci.dsp, DSP_FLUSH, 0); 336 dsp_configure(ci.dsp, DSP_FLUSH, 0);
336 337
338 /* Sync position */
339 audio_codec_update_offset(ci.curpos);
340
337 /* Post notification to audio thread */ 341 /* Post notification to audio thread */
338 LOGFQUEUE("audio > Q_AUDIO_CODEC_SEEK_COMPLETE"); 342 audio_codec_seek_complete();
339 audio_queue_post(Q_AUDIO_CODEC_SEEK_COMPLETE, 0);
340 343
341 /* Wait for urgent or go message */ 344 /* Wait for urgent or go message */
342 do 345 do
@@ -521,8 +524,7 @@ static void run_codec(void)
521 524
522 /* Notify audio that we're done for better or worse - advise of the 525 /* Notify audio that we're done for better or worse - advise of the
523 status */ 526 status */
524 LOGFQUEUE("codec > audio Q_AUDIO_CODEC_COMPLETE: %d", status); 527 audio_codec_complete(status);
525 audio_queue_post(Q_AUDIO_CODEC_COMPLETE, status);
526 } 528 }
527} 529}
528 530