
static void js_amix_finalize(JSRuntime *rt, JSValue obj)
{
	AMixCtx *mix = JS_GetOpaque(obj, amix_class_id);
	if (!mix) return;

	if (mix->chan_buf) gf_free(mix->chan_buf);
	if (mix->inputs) gf_free(mix->inputs);
	if (mix->in_chan_buf) gf_free(mix->in_chan_buf);
	gf_free(mix);

static void js_amix_finalize(JSRuntime *rt, JSValue obj)
{
	AMixCtx *mix = JS_GetOpaque(obj, amix_class_id);
	if (!mix) return;

	if (mix->chan_buf) gf_free(mix->chan_buf);
	if (mix->inputs) gf_free(mix->inputs);
	if (mix->in_chan_buf) gf_free(mix->in_chan_buf);
	gf_free(mix);