diff options
author | 2009-11-12 19:13:13 +0100 | |
---|---|---|
committer | 2009-11-12 19:34:36 +0100 | |
commit | 1220a7453592878ae09711d64c80d99149a621b2 (patch) | |
tree | 58bd0dba2b9d805177d50dd1601e913d51c093bf | |
parent | 69e0ddb79f353cbf67cbf8db9517e2e71ed87d5c (diff) |
flac plugin allocates buffer only when used
-rw-r--r-- | plugins/flac/flac.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index 13862b3b..776e3e95 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -32,7 +32,7 @@ static DB_functions_t *deadbeef; static FLAC__StreamDecoder *decoder = 0; #define BUFFERSIZE 100000 -static char buffer[BUFFERSIZE]; // this buffer always has float samples +static char *buffer; // this buffer always has float samples static int remaining; // bytes remaining in buffer from last read static int startsample; static int endsample; @@ -208,6 +208,7 @@ cflac_init (DB_playItem_t *it) { } remaining = 0; + buffer = malloc (BUFFERSIZE); return 0; } @@ -217,6 +218,10 @@ cflac_free (void) { FLAC__stream_decoder_delete(decoder); decoder = NULL; } + if (buffer) { + free (buffer); + buffer = NULL; + } } static int |