input/rewind: copy the MIME type only once
Reduce heap usage by reducing the number of malloc() / free() calls.
This commit is contained in:
parent
c345c5ebae
commit
48a84ca23e
2
NEWS
2
NEWS
|
@ -1,5 +1,7 @@
|
|||
ver 0.16.5 (2010/??/??)
|
||||
* pcm_format: fix 32-to-24 bit conversion (the "silence" bug)
|
||||
* input:
|
||||
- rewind: reduce heap usage
|
||||
|
||||
|
||||
ver 0.16.4 (2011/09/01)
|
||||
|
|
|
@ -83,12 +83,14 @@ copy_attributes(struct input_rewind *r)
|
|||
assert(dest != src);
|
||||
assert(src->mime == NULL || dest->mime != src->mime);
|
||||
|
||||
bool dest_ready = dest->ready;
|
||||
|
||||
dest->ready = src->ready;
|
||||
dest->seekable = src->seekable;
|
||||
dest->size = src->size;
|
||||
dest->offset = src->offset;
|
||||
|
||||
if (src->mime != NULL) {
|
||||
if (!dest_ready && src->ready) {
|
||||
g_free(dest->mime);
|
||||
dest->mime = g_strdup(src->mime);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue