From 28b6ce39d3d88d0159b54c8ca558e993eac93056 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 24 Nov 2014 19:56:01 +0100 Subject: audio: make mp_chmap_to_str() return a stack-allocated string Simplifies memory management. --- audio/out/ao.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'audio/out/ao.c') diff --git a/audio/out/ao.c b/audio/out/ao.c index f0461b8c09..893699e2f5 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -214,10 +214,9 @@ static struct ao *ao_alloc_pb(bool probing, struct mpv_global *global, static int ao_init(struct ao *ao) { - char *chmap = mp_chmap_to_str(&ao->channels); MP_VERBOSE(ao, "requested format: %d Hz, %s channels, %s\n", - ao->samplerate, chmap, af_fmt_to_str(ao->format)); - talloc_free(chmap); + ao->samplerate, mp_chmap_to_str(&ao->channels), + af_fmt_to_str(ao->format)); ao->api = ao->driver->play ? &ao_api_push : &ao_api_pull; ao->api_priv = talloc_zero_size(ao, ao->api->priv_size); -- cgit v1.2.3