Le 2012-07-27 15:24, Bertrik Sikken a écrit : > On 26-7-2012 8:25, Rafaël Carré wrote: >> Le 2012-07-26 14:08, Bertrik Sikken a écrit :
>> Ideally we should go and replace malloc() by static buffers using worst >> case possibilities when possible. > > The mallocs still being done, are done only at initialisation time, > there is no malloc/free during playback, so using malloc for these > is fine IMO. We can initialise the malloc subsystem (e.g. through > a call to codec_init()) for each file we play. > I think this should work and isn't so bad; conversion to static buffers > probably requires changes (e.g. in ogg and opus) that probably make it > harder to sync with upstream later. In this case, keeping malloc() is the right thing to do. I had seen some dangerous code, but I realise it is part of a test program (opus_compare.c) so it doesn't affect us. By the way do we want to remove unused files from git? It would make grepping easier, but also syncing with future libopus updates a bit harder. A compromise would be to mention these unused files in README.rockbox >>> * Stack usage is still quite high, I've seen about 10k for music and 36k >>> for speech on the clip zip, our stacks are currently 10kB by default. >> >> I'd guess some big buffers are allocated on stack (rather than usage >> being due to recursion) > > Gregory Maxwell from opus was looking into this a bit and I think he > identified the largest stack users. I guess this will end up being > a change in opus itself. OK let's see what he says. >>> * Applying global gain from the opus audio file is not implemented >>> (not sure if replaygain is working) >> >> Fixed (it's part of the codec, not related to replaygain although we >> might want to implement replaygain for e.g. vorbis too). > > Thanks. No problem, it turned out to be a oneliner ;) > (Replaygain for vorbis/upus doesn't look that complicated really, BTW). Yes it should be just a matter of reading the tags and calling the right rockbox function, e.g. like parserva2() in metadata/i3dtags.c