Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: CODEC_SIZE too small for the iriver simulator

Re: CODEC_SIZE too small for the iriver simulator

From: Frederic Devernay <frederic.devernay_at_m4x.org>
Date: Tue, 26 Jul 2005 16:39:24 +0200

Here's a fix to at least avoid crashing rockbox:

Index: apps/codecs.c
===================================================================
RCS file: /cvsroot/rockbox/apps/codecs.c,v
retrieving revision 1.11
diff -u -3 -p -r1.11 codecs.c
--- apps/codecs.c 12 Jul 2005 16:45:38 -0000 1.11
+++ apps/codecs.c 26 Jul 2005 13:31:59 -0000
_at__at_ -304,7 +304,8 _at__at_ int codec_load_file(const char *plugin)

      rc = read(fd, &codecbuf[0], CODEC_SIZE);
      close(fd);
- if (rc <= 0) {
+ /* if rc == CODEC_SIZE, then the codec is probably larger */
+ if (rc <= 0 || rc == CODEC_SIZE) {
          logf("Codec read error");
          return CODEC_ERROR;
      }

Moreover, every config-h*.h should have something like that to allow loading
codecs in the simulator:
/* The number of bytes reserved for loadable codecs */
#ifdef SIMULATOR
#define CODEC_SIZE 0x80000
#else
#define CODEC_SIZE 0x40000
#endif

Frederic Devernay wrote:
> Hi,
> CODEC_SIZE is 256k on the iriver, but on the simulator, because of the
> debugging symbols, the flac and vorbis codecs are larger:
> 281489 Jul 26 12:24 flac.codec
> 299028 Jul 26 12:46 vorbis.codec
>
> should we raise CODEC_SIZE, maybe only on the simulator?
> Fred
>
> _______________________________________________
> http://cool.haxx.se/mailman/listinfo/rockbox
>
>

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox
Received on 2005-07-26

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy