From 1e00e3119fb5da8f02fe1a5deaa5edce219a7175 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 10 Jan 2023 15:18:12 +0100 Subject: ao_audiotrack: replace malloc with talloc --- audio/out/ao_audiotrack.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'audio/out') diff --git a/audio/out/ao_audiotrack.c b/audio/out/ao_audiotrack.c index fbbdaa1c7a..d11109d085 100644 --- a/audio/out/ao_audiotrack.c +++ b/audio/out/ao_audiotrack.c @@ -648,11 +648,6 @@ static void uninit(struct ao *ao) p->timestamp = NULL; } - if (p->chunk) { - free(p->chunk); - p->chunk = NULL; - } - pthread_cond_destroy(&p->wakeup); pthread_mutex_destroy(&p->lock); @@ -728,7 +723,7 @@ static int init(struct ao *ao) ao->device_buffer = p->size / af_fmt_to_bytes(ao->format); p->chunksize = p->size; - p->chunk = malloc(p->size); + p->chunk = talloc_size(ao, p->size); jobject timestamp = MP_JNI_NEW(AudioTimestamp.clazz, AudioTimestamp.ctor); if (!timestamp || MP_JNI_EXCEPTION_LOG(ao) < 0) { -- cgit v1.2.3