[prev in list] [next in list] [prev in thread] [next in thread]
List: xaudio-sdk
Subject: [xaudio-sdk] [xaudio-sdk 3.2.9.5] output filter module modifying buffer (not
From: kylekey () telocity ! com
Date: 2001-07-23 19:24:56
[Download RAW message or body]
sorry for the repost - forgot subject!
I saw the sample rate conversion output filter in the
example source code for the filter module. In this
example the conversion is done in place and the
contents of the supplied buffer are modified. I
would like to change the size of that buffer, and or
create a new one and pass that along the filter chain.
Has anyone ever modified the buffer, not just the
contents of the buffer, that is being
pass along. See code below as an example of
what I'm trying to do:
static int
output_filter_write(XA_OutputFilterNode *node,
void *buffer,
unsigned long size,
unsigned int bytes_per_sample,
unsigned int channels,
unsigned int sample_rate)
{
short *samples = (short *)buffer;
unsigned int i;
buffer = realloc(buffer,size*2);
return node->next->vtable.output_write(node->next,
buffer,
size*2,
bytes_per_sample,
channels,
sample_rate);
}
OR
static int
output_filter_write(XA_OutputFilterNode *node,
void *buffer,
unsigned long size,
unsigned int bytes_per_sample,
unsigned int channels,
unsigned int sample_rate)
{
short *samples = calloc(size*2,1);
unsigned int i;
return node->next->vtable.output_write(node->next,
(void*)samples,
size*2,
bytes_per_sample,
channels,
sample_rate);
}
With either of these, the changes seem to be ignored.
Thanks in advance.
Kyle Key
Bright Eye Solutions, Inc.
_______________________________________________
xaudio-sdk mailing list
xaudio-sdk@mpegtv.com
http://mailman.bok.net/mailman/listinfo/xaudio-sdk
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic