diff options
author | Dave Chapman <dave@dchapman.com> | 2005-02-16 16:06:06 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2005-02-16 16:06:06 +0000 |
commit | a9b7109b6778fb90d8321f888b822e2a3085833c (patch) | |
tree | 68c3156eecd675a7ae064817d0fca1184589ea7e /apps | |
parent | 594b690af2df95d14cb927c6fff6717461d4873e (diff) | |
download | rockbox-a9b7109b6778fb90d8321f888b822e2a3085833c.tar.gz rockbox-a9b7109b6778fb90d8321f888b822e2a3085833c.zip |
More code cleanups
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5980 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/a52towav.c | 4 | ||||
-rw-r--r-- | apps/plugins/xxx2wav.h | 17 |
2 files changed, 12 insertions, 9 deletions
diff --git a/apps/plugins/a52towav.c b/apps/plugins/a52towav.c index 552479b0b0..3e81c9db0c 100644 --- a/apps/plugins/a52towav.c +++ b/apps/plugins/a52towav.c | |||
@@ -175,7 +175,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) | |||
175 | 175 | ||
176 | /* This function sets up the buffers and reads the file into RAM */ | 176 | /* This function sets up the buffers and reads the file into RAM */ |
177 | 177 | ||
178 | if (local_init(file,&file_info)) { | 178 | if (local_init(file,"/ac3test.wav",&file_info)) { |
179 | return PLUGIN_ERROR; | 179 | return PLUGIN_ERROR; |
180 | } | 180 | } |
181 | 181 | ||
@@ -190,6 +190,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file) | |||
190 | /* The main decoding loop */ | 190 | /* The main decoding loop */ |
191 | 191 | ||
192 | file_info.start_tick=*(rb->current_tick); | 192 | file_info.start_tick=*(rb->current_tick); |
193 | rb->button_clear_queue(); | ||
194 | |||
193 | while (file_info.curpos < file_info.filesize) { | 195 | while (file_info.curpos < file_info.filesize) { |
194 | 196 | ||
195 | if ((file_info.curpos+BUFFER_SIZE) < file_info.filesize) { | 197 | if ((file_info.curpos+BUFFER_SIZE) < file_info.filesize) { |
diff --git a/apps/plugins/xxx2wav.h b/apps/plugins/xxx2wav.h index 96942824fd..1b93cf9d31 100644 --- a/apps/plugins/xxx2wav.h +++ b/apps/plugins/xxx2wav.h | |||
@@ -55,7 +55,7 @@ void* malloc(size_t size) { | |||
55 | x=&mallocbuf[mem_ptr]; | 55 | x=&mallocbuf[mem_ptr]; |
56 | mem_ptr+=size+(size%4); // Keep memory 32-bit aligned (if it was already?) | 56 | mem_ptr+=size+(size%4); // Keep memory 32-bit aligned (if it was already?) |
57 | 57 | ||
58 | rb->snprintf(s,30,"Memory used: %d\r",mem_ptr); | 58 | rb->snprintf(s,30,"Memory used: %d",mem_ptr); |
59 | rb->lcd_putsxy(0,80,s); | 59 | rb->lcd_putsxy(0,80,s); |
60 | rb->lcd_update(); | 60 | rb->lcd_update(); |
61 | return(x); | 61 | return(x); |
@@ -111,11 +111,11 @@ void display_status(file_info_struct* file_info) { | |||
111 | unsigned long long speed; | 111 | unsigned long long speed; |
112 | unsigned long xspeed; | 112 | unsigned long xspeed; |
113 | 113 | ||
114 | rb->snprintf(s,32,"Bytes read: %d\r",file_info->curpos); | 114 | rb->snprintf(s,32,"Bytes read: %d",file_info->curpos); |
115 | rb->lcd_putsxy(0,0,s); | 115 | rb->lcd_putsxy(0,0,s); |
116 | rb->snprintf(s,32,"Samples Decoded: %d\r",file_info->current_sample); | 116 | rb->snprintf(s,32,"Samples Decoded: %d",file_info->current_sample); |
117 | rb->lcd_putsxy(0,20,s); | 117 | rb->lcd_putsxy(0,20,s); |
118 | rb->snprintf(s,32,"Frames Decoded: %d\r",file_info->frames_decoded); | 118 | rb->snprintf(s,32,"Frames Decoded: %d",file_info->frames_decoded); |
119 | rb->lcd_putsxy(0,40,s); | 119 | rb->lcd_putsxy(0,40,s); |
120 | 120 | ||
121 | ticks_taken=*(rb->current_tick)-file_info->start_tick; | 121 | ticks_taken=*(rb->current_tick)-file_info->start_tick; |
@@ -154,7 +154,7 @@ static unsigned char wav_header[44]={'R','I','F','F', // 0 - ChunkID | |||
154 | }; | 154 | }; |
155 | 155 | ||
156 | 156 | ||
157 | int local_init(char* file, file_info_struct* file_info) { | 157 | int local_init(char* infilename, char* outfilename, file_info_struct* file_info) { |
158 | char s[32]; | 158 | char s[32]; |
159 | int i,n,bytesleft; | 159 | int i,n,bytesleft; |
160 | 160 | ||
@@ -163,14 +163,15 @@ int local_init(char* file, file_info_struct* file_info) { | |||
163 | mallocbuf=mp3buf; | 163 | mallocbuf=mp3buf; |
164 | filebuf=&mp3buf[MALLOC_BUFSIZE]; | 164 | filebuf=&mp3buf[MALLOC_BUFSIZE]; |
165 | 165 | ||
166 | rb->snprintf(s,32,"mp3 bufsize: %d\r",bufsize); | 166 | rb->snprintf(s,32,"mp3 bufsize: %d",bufsize); |
167 | rb->lcd_putsxy(0,100,s); | 167 | rb->lcd_putsxy(0,100,s); |
168 | rb->lcd_update(); | 168 | rb->lcd_update(); |
169 | 169 | ||
170 | file_info->infile=rb->open(file,O_RDONLY); | 170 | file_info->infile=rb->open(infilename,O_RDONLY); |
171 | file_info->outfile=rb->creat("/ac3test.wav",O_WRONLY); | 171 | file_info->outfile=rb->creat(outfilename,O_WRONLY); |
172 | rb->write(file_info->outfile,wav_header,sizeof(wav_header)); | 172 | rb->write(file_info->outfile,wav_header,sizeof(wav_header)); |
173 | file_info->curpos=0; | 173 | file_info->curpos=0; |
174 | file_info->current_sample=0; | ||
174 | file_info->frames_decoded=0; | 175 | file_info->frames_decoded=0; |
175 | file_info->filesize=rb->filesize(file_info->infile); | 176 | file_info->filesize=rb->filesize(file_info->infile); |
176 | 177 | ||