changeset 3708:6f4068a0f291

make sndstretch work properly
author William Pitcock <nenolod@atheme.org>
date Mon, 08 Oct 2007 01:36:41 -0500
parents 1baa8e00c9d7
children a89a12aa4f2c
files src/audacious/flow.c src/audacious/flow.h src/audacious/output.c
diffstat 3 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 *
--- 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);
--- 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)