jack: Use jack_free(3) to release ports

Port objects acquired with jack_get_ports() need to be freed with
jack_free(3), not stdlib free().

On Windows, Jack may be linked against different libc than GStreamer
libraries so free()ing port objects directly might cause crash because
of libc mismatch.
This commit is contained in:
okuoku 2019-04-24 02:38:32 +09:00
parent aadfa5f20f
commit 05089a7092
2 changed files with 5 additions and 5 deletions

View file

@ -488,7 +488,7 @@ gst_jack_ring_buffer_acquire (GstAudioRingBuffer * buf,
if (res != 0 && res != EEXIST)
goto cannot_connect;
}
free (ports);
jack_free (ports);
}
done:
@ -523,7 +523,7 @@ cannot_connect:
GST_ELEMENT_ERROR (sink, RESOURCE, SETTINGS, (NULL),
("Could not connect output ports to physical ports (%d:%s)",
res, g_strerror (res)));
free (ports);
jack_free (ports);
return FALSE;
}
}
@ -927,7 +927,7 @@ gst_jack_audio_sink_getcaps (GstBaseSink * bsink, GstCaps * filter)
max = 0;
if (ports != NULL) {
for (; ports[max]; max++);
free (ports);
jack_free (ports);
} else
max = 0;
} else {

View file

@ -502,7 +502,7 @@ gst_jack_ring_buffer_acquire (GstAudioRingBuffer * buf,
if (res != 0 && res != EEXIST)
goto cannot_connect;
}
free (ports);
jack_free (ports);
}
done:
@ -537,7 +537,7 @@ cannot_connect:
GST_ELEMENT_ERROR (src, RESOURCE, SETTINGS, (NULL),
("Could not connect input ports to physical ports (%d:%s)",
res, g_strerror (res)));
free (ports);
jack_free (ports);
return FALSE;
}
}