0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

ao_coreaudio: fix some minor memory leaks

This commit is contained in:
wm4 2015-10-21 18:53:34 +02:00
parent eb66038d4f
commit cee9aeaf6b

View File

@ -180,6 +180,8 @@ static void init_physical_format(struct ao *ao)
struct priv *p = ao->priv;
OSErr err;
void *tmp = talloc_new(NULL);
AudioStreamBasicDescription asbd;
ca_fill_asbd(ao, &asbd);
@ -190,6 +192,8 @@ static void init_physical_format(struct ao *ao)
&streams, &n_streams);
CHECK_CA_ERROR("could not get number of streams");
talloc_steal(tmp, streams);
MP_VERBOSE(ao, "Found %zd substream(s).\n", n_streams);
for (int i = 0; i < n_streams; i++) {
@ -204,6 +208,7 @@ static void init_physical_format(struct ao *ao)
if (!CHECK_CA_WARN("could not get number of stream formats"))
continue; // try next one
talloc_steal(tmp, formats);
uint32_t direction;
err = CA_GET(streams[i], kAudioStreamPropertyDirection, &direction);
@ -239,6 +244,7 @@ static void init_physical_format(struct ao *ao)
}
coreaudio_error:
talloc_free(tmp);
return;
}