92 |
} |
} |
93 |
} |
} |
94 |
|
|
95 |
DEBUG(("using softvol with factors left: %d, right: %d (%d/%d)\n", factor_left, factor_right, |
DEBUG(("using softvol with factors left: %d, right: %d (%d/%d)\n", factor_left, |
96 |
format->wBitsPerSample, format->nChannels)); |
factor_right, format->wBitsPerSample, format->nChannels)); |
97 |
} |
} |
98 |
|
|
99 |
void |
void |
113 |
} |
} |
114 |
} |
} |
115 |
|
|
|
unsigned char * |
|
|
rdpsnd_dsp_process(unsigned char *inbuffer, unsigned int size, struct audio_driver *current_driver, |
|
|
WAVEFORMATEX * format) |
|
|
{ |
|
|
unsigned char *outbuffer; |
|
|
|
|
|
outbuffer = xmalloc(size); |
|
116 |
|
|
117 |
memcpy(outbuffer, inbuffer, size); |
STREAM |
118 |
|
rdpsnd_dsp_process(STREAM s, struct audio_driver *current_driver, WAVEFORMATEX * format) |
119 |
|
{ |
120 |
|
static struct stream out; |
121 |
|
|
122 |
/* Software volume control */ |
/* softvol and byteswap do not change the amount of data they |
123 |
|
return, so they can operate on the input-stream */ |
124 |
if (current_driver->wave_out_volume == rdpsnd_dsp_softvol_set) |
if (current_driver->wave_out_volume == rdpsnd_dsp_softvol_set) |
125 |
rdpsnd_dsp_softvol(outbuffer, size, format); |
rdpsnd_dsp_softvol(s->data, s->size, format); |
126 |
|
|
127 |
#ifdef B_ENDIAN |
#ifdef B_ENDIAN |
128 |
if (current_driver->need_byteswap_on_be) |
if (current_driver->need_byteswap_on_be) |
129 |
rdpsnd_dsp_swapbytes(outbuffer, size, format); |
rdpsnd_dsp_swapbytes(s->data, s->size, format); |
130 |
#endif |
#endif |
131 |
|
|
132 |
return outbuffer; |
/* FIXME: where do we lose the 4 bytes referenced here? */ |
133 |
|
out.data = xmalloc(s->size - 4); |
134 |
|
|
135 |
|
memcpy(out.data, s->data + 4, s->size - 4); |
136 |
|
|
137 |
|
out.size = s->size - 4; |
138 |
|
out.p = out.data; |
139 |
|
out.end = out.p + out.size; |
140 |
|
|
141 |
|
return &out; |
142 |
} |
} |