diff options
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/battery_test.c | 2 | ||||
| -rw-r--r-- | apps/plugins/jpeg.c | 2 | ||||
| -rw-r--r-- | apps/plugins/lib/xxx2wav.c | 14 | ||||
| -rw-r--r-- | apps/plugins/rockboy.c | 9 | ||||
| -rw-r--r-- | apps/plugins/rockboy/rockboy.c | 34 | ||||
| -rw-r--r-- | apps/plugins/sort.c | 2 | ||||
| -rw-r--r-- | apps/plugins/vbrfix.c | 26 | ||||
| -rw-r--r-- | apps/plugins/video.c | 2 |
8 files changed, 46 insertions, 45 deletions
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c index 73affdd..47042e6 100644 --- a/apps/plugins/battery_test.c +++ b/apps/plugins/battery_test.c @@ -48,7 +48,7 @@ int buffersize; int init(void) { int f; - buffer = rb->plugin_get_mp3_buffer(&buffersize); + buffer = rb->plugin_get_audio_buffer(&buffersize); #ifdef HAVE_MMC /* present info what's going on. MMC is slow. */ diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c index f705271..7ca59b2 100644 --- a/apps/plugins/jpeg.c +++ b/apps/plugins/jpeg.c @@ -1824,7 +1824,7 @@ int main(char* filename) rb->memset(&disp, 0, sizeof(disp)); - buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */ + buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */ /* initialize the grayscale buffer: diff --git a/apps/plugins/lib/xxx2wav.c b/apps/plugins/lib/xxx2wav.c index 4d0c139..d864527 100644 --- a/apps/plugins/lib/xxx2wav.c +++ b/apps/plugins/lib/xxx2wav.c @@ -29,9 +29,9 @@ static struct plugin_api* local_rb; int mem_ptr; int bufsize; -unsigned char* mp3buf; // The actual MP3 buffer from Rockbox -unsigned char* mallocbuf; // 512K from the start of MP3 buffer -unsigned char* filebuf; // The rest of the MP3 buffer +unsigned char* audiobuf; // The actual audio buffer from Rockbox +unsigned char* mallocbuf; // 512K from the start of audio buffer +unsigned char* filebuf; // The rest of the audio buffer void* codec_malloc(size_t size) { void* x; @@ -169,11 +169,11 @@ int local_init(char* infilename, char* outfilename, file_info_struct* file_info, local_rb=rb; mem_ptr=0; - mp3buf=local_rb->plugin_get_mp3_buffer(&bufsize); - mallocbuf=mp3buf; - filebuf=&mp3buf[MALLOC_BUFSIZE]; + audiobuf=local_rb->plugin_get_audio_buffer(&bufsize); + mallocbuf=audiobuf; + filebuf=&audiobuf[MALLOC_BUFSIZE]; - local_rb->snprintf(s,32,"mp3 bufsize: %d",bufsize); + local_rb->snprintf(s,32,"audio bufsize: %d",bufsize); local_rb->lcd_putsxy(0,100,s); local_rb->lcd_update(); diff --git a/apps/plugins/rockboy.c b/apps/plugins/rockboy.c index 4778fa8..d531c94 100644 --- a/apps/plugins/rockboy.c +++ b/apps/plugins/rockboy.c @@ -26,8 +26,8 @@ #define OVL_DISPLAYNAME "RockBoy" struct plugin_api* rb; -unsigned char *mp3buf; -int mp3buf_size; +unsigned char *audiobuf; +int audiobuf_size; /* this is the plugin entry point */ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) @@ -60,8 +60,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) return PLUGIN_ERROR; } - mp3buf = rb->plugin_get_mp3_buffer(&mp3buf_size); - if (header.start_addr < mp3buf || header.end_addr > mp3buf + mp3buf_size) + audiobuf = rb->plugin_get_audio_buffer(&audiobuf_size); + if (header.start_addr < audiobuf || + header.end_addr > audiobuf + audiobuf_size) { rb->close(fh); rb->splash(2*HZ, true, OVL_DISPLAYNAME diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index c6d006a..1b4c0c7 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -59,37 +59,37 @@ void die(char *message, ...) errormsg=message; } -void *mp3_bufferbase; -void *mp3_bufferpointer; -unsigned int mp3_buffer_free; +void *audio_bufferbase; +void *audio_bufferpointer; +unsigned int audio_buffer_free; void *my_malloc(size_t size) { void *alloc; - if (!mp3_bufferbase) + if (!audio_bufferbase) { - mp3_bufferbase = mp3_bufferpointer - = rb->plugin_get_mp3_buffer(&mp3_buffer_free); + audio_bufferbase = audio_bufferpointer + = rb->plugin_get_audio_buffer(&audio_buffer_free); #if MEM <= 8 && !defined(SIMULATOR) /* loaded as an overlay, protect from overwriting ourselves */ - if ((unsigned)(ovl_start_addr - (unsigned char *)mp3_bufferbase) - < mp3_buffer_free) - mp3_buffer_free = ovl_start_addr - (unsigned char *)mp3_bufferbase; + if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase) + < audio_buffer_free) + audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase; #endif } - if (size + 4 > mp3_buffer_free) + if (size + 4 > audio_buffer_free) return 0; - alloc = mp3_bufferpointer; - mp3_bufferpointer += size + 4; - mp3_buffer_free -= size + 4; + alloc = audio_bufferpointer; + audio_bufferpointer += size + 4; + audio_buffer_free -= size + 4; return alloc; } void setmallocpos(void *pointer) { - mp3_bufferpointer = pointer; - mp3_buffer_free = mp3_bufferpointer - mp3_bufferbase; + audio_bufferpointer = pointer; + audio_buffer_free = audio_bufferpointer - audio_bufferbase; } /* this is the plugin entry point */ @@ -113,8 +113,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) #endif shut=0; cleanshut=0; - mp3_bufferbase=mp3_bufferpointer=0; - mp3_buffer_free=0; + audio_bufferbase=audio_bufferpointer=0; + audio_buffer_free=0; /* now go ahead and have fun! */ /* rb->splash(HZ*2, true, "Rockboy v0.3"); */ diff --git a/apps/plugins/sort.c b/apps/plugins/sort.c index b17f5a4..cf91dbb 100644 --- a/apps/plugins/sort.c +++ b/apps/plugins/sort.c @@ -184,7 +184,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) rb = api; - buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */ + buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */ stringbuffer = buf; pointers = (char **)(buf + buf_size - sizeof(int)); diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c index 0077340..7fb072c 100644 --- a/apps/plugins/vbrfix.c +++ b/apps/plugins/vbrfix.c @@ -20,8 +20,8 @@ static struct plugin_api* rb; -static char *mp3buf; -static int mp3buflen; +static char *audiobuf; +static int audiobuflen; static void xingupdate(int percent) { @@ -56,14 +56,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes) /* First, copy the initial portion (the ID3 tag) */ if(fpos) { - readlen = rb->read(orig_fd, mp3buf, fpos); + readlen = rb->read(orig_fd, audiobuf, fpos); if(readlen < 0) { rb->close(fd); rb->close(orig_fd); return 10*readlen - 3; } - rc = rb->write(fd, mp3buf, readlen); + rc = rb->write(fd, audiobuf, readlen); if(rc < 0) { rb->close(fd); rb->close(orig_fd); @@ -81,14 +81,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes) /* Copy the file */ do { - readlen = rb->read(orig_fd, mp3buf, mp3buflen); + readlen = rb->read(orig_fd, audiobuf, audiobuflen); if(readlen < 0) { rb->close(fd); rb->close(orig_fd); return 10*readlen - 7; } - rc = rb->write(fd, mp3buf, readlen); + rc = rb->write(fd, audiobuf, readlen); if(rc < 0) { rb->close(fd); rb->close(orig_fd); @@ -193,8 +193,8 @@ static bool vbr_fix(char *selected_file) and write it to the file */ if(unused_space) { - rb->memset(mp3buf, 0, unused_space); - rc = rb->write(fd, mp3buf, unused_space); + rb->memset(audiobuf, 0, unused_space); + rc = rb->write(fd, audiobuf, unused_space); if(rc < 0) { rb->close(fd); fileerror(rc); @@ -230,20 +230,20 @@ static bool vbr_fix(char *selected_file) DEBUGF("Inserting 4096+%d bytes\n", framelen); numbytes = 4096 + framelen; - rb->memset(mp3buf + 0x100000, 0, numbytes); + rb->memset(audiobuf + 0x100000, 0, numbytes); /* Insert the ID3 header */ - rb->memcpy(mp3buf + 0x100000, empty_id3_header, + rb->memcpy(audiobuf + 0x100000, empty_id3_header, sizeof(empty_id3_header)); } /* Copy the Xing header */ - rb->memcpy(mp3buf + 0x100000 + numbytes - framelen, + rb->memcpy(audiobuf + 0x100000 + numbytes - framelen, xingbuf, framelen); rc = insert_data_in_file(selected_file, entry.first_frame_offset, - mp3buf + 0x100000, numbytes); + audiobuf + 0x100000, numbytes); if(rc < 0) { fileerror(rc); @@ -272,7 +272,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void *parameter) if (!parameter) return PLUGIN_ERROR; - mp3buf = rb->plugin_get_mp3_buffer(&mp3buflen); + audiobuf = rb->plugin_get_audio_buffer(&audiobuflen); vbr_fix(parameter); diff --git a/apps/plugins/video.c b/apps/plugins/video.c index 0257ad2..db37139 100644 --- a/apps/plugins/video.c +++ b/apps/plugins/video.c @@ -864,7 +864,7 @@ int main(char* filename) // init buffer rb->memset(&gBuf, 0, sizeof(gBuf)); gBuf.pOSD = rb->lcd_framebuffer + LCD_WIDTH*7; // last screen line - gBuf.pBufStart = rb->plugin_get_mp3_buffer(&gBuf.bufsize); + gBuf.pBufStart = rb->plugin_get_audio_buffer(&gBuf.bufsize); //gBuf.bufsize = 1700*1024; // test, like 2MB version!!!! gBuf.pBufFill = gBuf.pBufStart; // all empty |