diff options
| author | Thom Johansen <thomj@rockbox.org> | 2007-11-01 21:34:15 +0000 |
|---|---|---|
| committer | Thom Johansen <thomj@rockbox.org> | 2007-11-01 21:34:15 +0000 |
| commit | 80e4d671d2271c8a6a3ec463c277fcf7b3fa3ab9 (patch) | |
| tree | 899b90e2c80053f010f8a6e552c8943d849ced12 /apps/codecs/libspeex | |
| parent | bf1b7f131c933b83afe62f01c200366e4e2e37f3 (diff) | |
| download | rockbox-80e4d671d2271c8a6a3ec463c277fcf7b3fa3ab9.zip rockbox-80e4d671d2271c8a6a3ec463c277fcf7b3fa3ab9.tar.gz rockbox-80e4d671d2271c8a6a3ec463c277fcf7b3fa3ab9.tar.bz2 rockbox-80e4d671d2271c8a6a3ec463c277fcf7b3fa3ab9.tar.xz | |
Make Speex read its input directly from the Ogg packet, which makes for less copying and one less malloc(). Thanks to Jean-Marc Valin for the tip.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15395 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libspeex')
| -rw-r--r-- | apps/codecs/libspeex/speex_header.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/codecs/libspeex/speex_header.c b/apps/codecs/libspeex/speex_header.c index 8fd1665..1cb25ac 100644 --- a/apps/codecs/libspeex/speex_header.c +++ b/apps/codecs/libspeex/speex_header.c @@ -128,10 +128,11 @@ char *speex_header_to_packet(SpeexHeader *header, int *size) } #endif +static SpeexHeader global_le_header; /* Avoid malloc */ SpeexHeader *speex_packet_to_header(char *packet, int size) { int i; - SpeexHeader *le_header; + SpeexHeader *le_header = &global_le_header; const char *h = "Speex "; for (i=0;i<8;i++) if (packet[i]!=h[i]) @@ -147,7 +148,7 @@ SpeexHeader *speex_packet_to_header(char *packet, int size) return NULL; } - le_header = (SpeexHeader*)speex_alloc(sizeof(SpeexHeader)); + /* le_header = (SpeexHeader*)speex_alloc(sizeof(SpeexHeader)); */ speex_move(le_header, packet, sizeof(SpeexHeader)); |