diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/test_codec.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 3c54610a94..b1f5aff385 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -111,6 +111,7 @@ static bool taginfo_ready = true; | |||
111 | 111 | ||
112 | static volatile unsigned int elapsed; | 112 | static volatile unsigned int elapsed; |
113 | static volatile bool codec_playing; | 113 | static volatile bool codec_playing; |
114 | static volatile long endtick; | ||
114 | struct wavinfo_t wavinfo; | 115 | struct wavinfo_t wavinfo; |
115 | 116 | ||
116 | static unsigned char wav_header[44] = | 117 | static unsigned char wav_header[44] = |
@@ -508,6 +509,7 @@ static void codec_thread(void) | |||
508 | res = rb->codec_load_file(codecname,&ci); | 509 | res = rb->codec_load_file(codecname,&ci); |
509 | 510 | ||
510 | /* Signal to the main thread that we are done */ | 511 | /* Signal to the main thread that we are done */ |
512 | endtick = *rb->current_tick; | ||
511 | codec_playing = false; | 513 | codec_playing = false; |
512 | } | 514 | } |
513 | 515 | ||
@@ -519,8 +521,8 @@ static enum plugin_status test_track(const char* filename) | |||
519 | size_t n; | 521 | size_t n; |
520 | int fd; | 522 | int fd; |
521 | enum plugin_status res = PLUGIN_ERROR; | 523 | enum plugin_status res = PLUGIN_ERROR; |
522 | unsigned long starttick; | 524 | long starttick; |
523 | unsigned long ticks; | 525 | long ticks; |
524 | unsigned long speed; | 526 | unsigned long speed; |
525 | unsigned long duration; | 527 | unsigned long duration; |
526 | struct thread_entry* codecthread_id; | 528 | struct thread_entry* codecthread_id; |
@@ -601,8 +603,7 @@ static enum plugin_status test_track(const char* filename) | |||
601 | rb->snprintf(str,sizeof(str),"%d of %d",elapsed,(int)track.id3.length); | 603 | rb->snprintf(str,sizeof(str),"%d of %d",elapsed,(int)track.id3.length); |
602 | log_text(str,false); | 604 | log_text(str,false); |
603 | } | 605 | } |
604 | /* Save the current time before we spin up the disk to access the log */ | 606 | ticks = endtick - starttick; |
605 | ticks = *rb->current_tick - starttick; | ||
606 | 607 | ||
607 | /* Be sure it is done */ | 608 | /* Be sure it is done */ |
608 | rb->thread_wait(codecthread_id); | 609 | rb->thread_wait(codecthread_id); |