# HG changeset patch # User William Pitcock # Date 1191825401 18000 # Node ID 6f4068a0f291374f542e63c9fdc6e9709e7ec958 # Parent 1baa8e00c9d7bae9f68971337c345600de3248f8 make sndstretch work properly diff -r 1baa8e00c9d7 -r 6f4068a0f291 src/audacious/flow.c --- a/src/audacious/flow.c Sun Oct 07 19:12:28 2007 -0500 +++ b/src/audacious/flow.c Mon Oct 08 01:36:41 2007 -0500 @@ -37,17 +37,18 @@ g_slice_free(Flow, flow); } -void flow_execute(Flow *flow, gint time, gpointer data, gsize len, AFormat fmt, +gsize +flow_execute(Flow *flow, gint time, gpointer *data, gsize len, AFormat fmt, gint srate, gint channels) { FlowElement *element; FlowContext context = {}; - g_return_if_fail(flow != NULL); - g_return_if_fail(data != NULL); + g_return_val_if_fail(flow != NULL, 0); + g_return_val_if_fail(data != NULL, 0); context.time = time; - context.data = data; + context.data = *data; context.len = len; context.fmt = fmt; context.srate = srate; @@ -61,6 +62,10 @@ if (context.error) break; } + + *data = context.data; + + return context.len; } Flow * diff -r 1baa8e00c9d7 -r 6f4068a0f291 src/audacious/flow.h --- a/src/audacious/flow.h Sun Oct 07 19:12:28 2007 -0500 +++ b/src/audacious/flow.h Mon Oct 08 01:36:41 2007 -0500 @@ -50,7 +50,7 @@ FlowElement *head, *tail; } Flow; -void flow_execute(Flow *flow, gint time, gpointer data, gsize len, AFormat fmt, +gsize flow_execute(Flow *flow, gint time, gpointer *data, gsize len, AFormat fmt, gint srate, gint channels); Flow *flow_new(void); diff -r 1baa8e00c9d7 -r 6f4068a0f291 src/audacious/output.c --- a/src/audacious/output.c Sun Oct 07 19:12:28 2007 -0500 +++ b/src/audacious/output.c Mon Oct 08 01:36:41 2007 -0500 @@ -473,7 +473,7 @@ } #endif - flow_execute(postproc_flow, time, ptr, length, op_state.fmt, op_state.rate, op_state.nch); + length = flow_execute(postproc_flow, time, &ptr, length, op_state.fmt, op_state.rate, op_state.nch); writeoffs = 0; while (writeoffs < length)