ao_audiotrack: replace malloc with talloc

This commit is contained in:
sfan5 2023-01-10 15:18:12 +01:00
parent d54f22f8b6
commit 1e00e3119f
1 changed files with 1 additions and 6 deletions

View File

@ -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) {