Mercurial > audlegacy
annotate src/audacious/output.c @ 3546:fd4cd1945b91 trunk
Connect volumecontrol flow to the work pipeline.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Tue, 18 Sep 2007 10:47:14 -0500 |
parents | 96baf555b449 |
children | a5b1084e7f38 |
rev | line source |
---|---|
2313 | 1 /* Audacious - Cross-platform multimedia player |
2 * Copyright (C) 2005-2007 Audacious team | |
3 * | |
4 * Based on BMP: | |
5 * Copyright (C) 2003-2004 BMP development team. | |
6 * | |
7 * Based on XMMS: | |
8 * Copyright (C) 1998-2003 XMMS development team. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
2813
diff
changeset
|
12 * the Free Software Foundation; under version 3 of the License. |
2313 | 13 * |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
2813
diff
changeset
|
20 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
21 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
22 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
23 * Audacious or using our public API to be a derived work. |
2313 | 24 */ |
25 | |
26 #ifdef HAVE_CONFIG_H | |
27 # include "config.h" | |
28 #endif | |
29 | |
30 #include "output.h" | |
31 #include "iir.h" | |
32 #include "main.h" | |
33 #include "input.h" | |
2328 | 34 #include "playback.h" |
2313 | 35 |
36 #include "playlist.h" | |
2717 | 37 #include "configdb.h" |
2542 | 38 |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
39 #include "effect.h" |
3546
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
40 #include "volumecontrol.h" |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
41 |
2542 | 42 #include <math.h> |
43 | |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
44 #ifdef USE_SRC |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
45 #include <samplerate.h> |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
46 #endif |
2313 | 47 |
48 OutputPluginData op_data = { | |
49 NULL, | |
50 NULL | |
51 }; | |
52 | |
53 OutputPluginState op_state = { | |
54 0, | |
55 0, | |
56 0 | |
57 }; | |
58 | |
59 OutputPlugin psuedo_output_plugin = { | |
60 NULL, | |
61 NULL, | |
62 "XMMS reverse compatibility output plugin", | |
63 NULL, | |
64 NULL, | |
65 NULL, | |
66 NULL, | |
3437
3092a8b3fe34
Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents:
3123
diff
changeset
|
67 TRUE, |
2313 | 68 output_get_volume, |
69 output_set_volume, | |
70 output_open_audio, | |
71 output_write_audio, | |
72 output_close_audio, | |
73 | |
74 output_flush, | |
75 output_pause, | |
76 output_buffer_free, | |
77 output_buffer_playing, | |
78 get_output_time, | |
79 get_written_time, | |
80 NULL | |
81 }; | |
82 | |
83 OutputPlugin * | |
84 get_current_output_plugin(void) | |
85 { | |
86 return op_data.current_output_plugin; | |
87 } | |
88 | |
89 void | |
90 set_current_output_plugin(gint i) | |
91 { | |
92 gboolean playing; | |
93 OutputPlugin *op = get_current_output_plugin(); | |
94 | |
95 GList *node = g_list_nth(op_data.output_list, i); | |
96 if (!node) { | |
97 op_data.current_output_plugin = NULL; | |
98 return; | |
99 } | |
100 | |
101 op_data.current_output_plugin = node->data; | |
102 | |
103 playing = playback_get_playing(); | |
104 | |
105 if (playing == TRUE) | |
106 { | |
107 guint time, pos; | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
108 PlaylistEntry *entry; |
2313 | 109 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
110 /* don't stop yet, get the seek time and playlist position first */ |
2313 | 111 pos = playlist_get_position(playlist_get_active()); |
112 time = op->output_time(); | |
113 | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
114 /* reset the audio system */ |
2313 | 115 mainwin_stop_pushed(); |
116 op->close_audio(); | |
117 | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
118 g_usleep(300000); |
2313 | 119 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
120 /* wait for the playback thread to come online */ |
2313 | 121 while (playback_get_playing()) |
122 g_message("waiting for audio system shutdown..."); | |
123 | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
124 /* wait for the playback thread to come online */ |
2313 | 125 playlist_set_position(playlist_get_active(), pos); |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
126 entry = playlist_get_entry_to_play(playlist_get_active()); |
2313 | 127 playback_play_file(entry); |
128 | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
129 while (!playback_get_playing()) |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
130 { |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
131 gtk_main_iteration(); |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
132 g_message("waiting for audio system startup..."); |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
133 } |
2313 | 134 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
135 /* and signal a reseek */ |
2313 | 136 if (playlist_get_current_length(playlist_get_active()) > -1 && |
137 time <= (playlist_get_current_length(playlist_get_active()))) | |
138 playback_seek(time / 1000); | |
139 } | |
140 } | |
141 | |
142 GList * | |
143 get_output_list(void) | |
144 { | |
145 return op_data.output_list; | |
146 } | |
147 | |
148 void | |
149 output_about(gint i) | |
150 { | |
151 OutputPlugin *out = g_list_nth(op_data.output_list, i)->data; | |
152 if (out && out->about) | |
153 out->about(); | |
154 } | |
155 | |
156 void | |
157 output_configure(gint i) | |
158 { | |
159 OutputPlugin *out = g_list_nth(op_data.output_list, i)->data; | |
160 if (out && out->configure) | |
161 out->configure(); | |
162 } | |
163 | |
164 void | |
165 output_get_volume(gint * l, gint * r) | |
166 { | |
167 *l = *r = -1; | |
168 | |
169 if (!op_data.current_output_plugin) | |
170 return; | |
171 | |
172 if (!op_data.current_output_plugin->get_volume) | |
173 return; | |
174 | |
3546
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
175 if (cfg.software_volume_control) |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
176 volumecontrol_get_volume_state(l, r); |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
177 else |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
178 op_data.current_output_plugin->get_volume(l, r); |
2313 | 179 } |
180 | |
181 void | |
182 output_set_volume(gint l, gint r) | |
183 { | |
184 if (!op_data.current_output_plugin) | |
185 return; | |
186 | |
187 if (!op_data.current_output_plugin->set_volume) | |
188 return; | |
189 | |
3546
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
190 if (cfg.software_volume_control) |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
191 volumecontrol_set_volume_state(l, r); |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
192 else |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
193 op_data.current_output_plugin->set_volume(l, r); |
2313 | 194 } |
195 | |
196 void | |
197 output_set_eq(gboolean active, gfloat pre, gfloat * bands) | |
198 { | |
199 int i; | |
200 preamp[0] = 1.0 + 0.0932471 * pre + 0.00279033 * pre * pre; | |
201 preamp[1] = 1.0 + 0.0932471 * pre + 0.00279033 * pre * pre; | |
202 | |
203 for (i = 0; i < 10; ++i) | |
204 { | |
2813
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
205 set_gain(i, 0, 0.03 * bands[i] + 0.000999999 * bands[i] * bands[i]); |
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
206 set_gain(i, 1, 0.03 * bands[i] + 0.000999999 * bands[i] * bands[i]); |
2313 | 207 } |
208 } | |
209 | |
210 /* this should be in BYTES, NOT gint16s */ | |
211 static void | |
212 byteswap(size_t size, | |
213 gint16 * buf) | |
214 { | |
215 gint16 *it; | |
216 size &= ~1; /* must be multiple of 2 */ | |
217 for (it = buf; it < buf + size / 2; ++it) | |
218 *(guint16 *) it = GUINT16_SWAP_LE_BE(*(guint16 *) it); | |
219 } | |
220 | |
221 /* called by input plugin to peek at the output plugin's write progress */ | |
222 gint | |
223 get_written_time(void) | |
224 { | |
225 OutputPlugin *op = get_current_output_plugin(); | |
226 | |
227 return op->written_time(); | |
228 } | |
229 | |
230 /* called by input plugin to peek at the output plugin's output progress */ | |
231 gint | |
232 get_output_time(void) | |
233 { | |
234 OutputPlugin *op = get_current_output_plugin(); | |
235 | |
236 return op->output_time(); | |
237 } | |
238 | |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
239 #ifdef USE_SRC |
2813
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
240 |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
241 static SRC_STATE *src_state; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
242 static SRC_DATA src_data; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
243 static int overSamplingFs = 96000; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
244 static int converter_type = SRC_SINC_BEST_QUALITY; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
245 static int srcError = 0; |
2648
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
246 |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
247 static float *srcIn = NULL, *srcOut = NULL; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
248 static short int *wOut = NULL; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
249 static int lengthOfSrcIn = 0; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
250 static int lengthOfSrcOut = 0; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
251 |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
252 static void freeSRC() |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
253 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
254 if(src_state != NULL) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
255 src_state = src_delete(src_state); |
2648
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
256 free(srcIn); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
257 free(srcOut); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
258 free(wOut); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
259 srcIn = NULL; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
260 srcOut = NULL; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
261 wOut = NULL; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
262 lengthOfSrcIn = 0; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
263 lengthOfSrcOut = 0; |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
264 } |
2813
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
265 |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
266 #endif |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
267 |
2313 | 268 gint |
269 output_open_audio(AFormat fmt, gint rate, gint nch) | |
270 { | |
271 gint ret; | |
272 OutputPlugin *op; | |
273 | |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
274 #ifdef USE_SRC |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
275 ConfigDb *db; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
276 gboolean src_enabled; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
277 gint src_rate, src_type; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
278 db = bmp_cfg_db_open(); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
279 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
280 if (bmp_cfg_db_get_bool(db, NULL, "enable_src", &src_enabled) == FALSE) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
281 src_enabled = FALSE; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
282 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
283 if (bmp_cfg_db_get_int(db, NULL, "src_rate", &src_rate) == FALSE) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
284 overSamplingFs = 48000; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
285 else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
286 overSamplingFs = src_rate; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
287 |
2649
153dc928115a
[svn] - don't resample if source rate matches the internal clock rate. closes #881.
nenolod
parents:
2648
diff
changeset
|
288 /* don't resample if sampling rates are the same --nenolod */ |
153dc928115a
[svn] - don't resample if source rate matches the internal clock rate. closes #881.
nenolod
parents:
2648
diff
changeset
|
289 if (rate == overSamplingFs) |
153dc928115a
[svn] - don't resample if source rate matches the internal clock rate. closes #881.
nenolod
parents:
2648
diff
changeset
|
290 src_enabled = FALSE; |
153dc928115a
[svn] - don't resample if source rate matches the internal clock rate. closes #881.
nenolod
parents:
2648
diff
changeset
|
291 |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
292 if (bmp_cfg_db_get_int(db, NULL, "src_type", &src_type) == FALSE) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
293 converter_type = SRC_SINC_BEST_QUALITY; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
294 else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
295 converter_type = src_type; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
296 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
297 bmp_cfg_db_close(db); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
298 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
299 freeSRC(); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
300 |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
301 if(src_enabled&& |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
302 (fmt == FMT_S16_NE||(fmt == FMT_S16_LE && G_BYTE_ORDER == G_LITTLE_ENDIAN)|| |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
303 (fmt == FMT_S16_BE && G_BYTE_ORDER == G_BIG_ENDIAN))) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
304 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
305 src_state = src_new(converter_type, nch, &srcError); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
306 if (src_state != NULL) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
307 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
308 src_data.src_ratio = (float)overSamplingFs/(float)rate; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
309 rate = overSamplingFs; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
310 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
311 else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
312 fprintf(stderr, "src_new(): %s\n\n", src_strerror(srcError)); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
313 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
314 #endif |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
315 |
2313 | 316 op = get_current_output_plugin(); |
317 | |
318 if (op == NULL) | |
319 return -1; | |
320 | |
321 /* Is our output port already open? */ | |
322 if ((op_state.rate != 0 && op_state.nch != 0) && | |
2813
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
323 (op_state.rate == rate && op_state.nch == nch && op_state.fmt == fmt)) |
2313 | 324 { |
2813
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
325 /* Yes, and it's the correct sampling rate. Reset the counter and go. */ |
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
326 op->flush(0); |
2313 | 327 return 1; |
328 } | |
329 else if (op_state.rate != 0 && op_state.nch != 0) | |
2813
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
330 op->close_audio(); |
2313 | 331 |
332 ret = op->open_audio(fmt, rate, nch); | |
333 | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
334 if (ret == 1) /* Success? */ |
2313 | 335 { |
336 op_state.fmt = fmt; | |
337 op_state.rate = rate; | |
338 op_state.nch = nch; | |
339 } | |
340 | |
341 return ret; | |
342 } | |
343 | |
344 void | |
345 output_write_audio(gpointer ptr, gint length) | |
346 { | |
347 OutputPlugin *op = get_current_output_plugin(); | |
348 | |
349 /* Sanity check. */ | |
350 if (op == NULL) | |
351 return; | |
352 | |
353 op->write_audio(ptr, length); | |
354 } | |
355 | |
356 void | |
357 output_close_audio(void) | |
358 { | |
359 OutputPlugin *op = get_current_output_plugin(); | |
360 | |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
361 #ifdef USE_SRC |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
362 freeSRC(); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
363 #endif |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
364 |
2313 | 365 /* Do not close if there are still songs to play and the user has |
366 * not requested a stop. --nenolod | |
367 */ | |
368 if (ip_data.stop == FALSE && | |
2673 | 369 (playlist_get_position_nolock(playlist_get_active()) < |
370 playlist_get_length(playlist_get_active()) - 1)) | |
2313 | 371 return; |
372 | |
373 /* Sanity check. */ | |
374 if (op == NULL) | |
375 return; | |
376 | |
377 op->close_audio(); | |
378 | |
379 /* Reset the op_state. */ | |
380 op_state.fmt = op_state.rate = op_state.nch = 0; | |
381 } | |
382 | |
383 void | |
384 output_flush(gint time) | |
385 { | |
386 OutputPlugin *op = get_current_output_plugin(); | |
387 | |
388 if (op == NULL) | |
389 return; | |
390 | |
391 op->flush(time); | |
392 } | |
393 | |
394 void | |
395 output_pause(gshort paused) | |
396 { | |
397 OutputPlugin *op = get_current_output_plugin(); | |
398 | |
399 if (op == NULL) | |
400 return; | |
401 | |
402 op->pause(paused); | |
403 } | |
404 | |
405 gint | |
406 output_buffer_free(void) | |
407 { | |
408 OutputPlugin *op = get_current_output_plugin(); | |
409 | |
410 if (op == NULL) | |
411 return 0; | |
412 | |
413 return op->buffer_free(); | |
414 } | |
415 | |
416 gint | |
417 output_buffer_playing(void) | |
418 { | |
419 OutputPlugin *op = get_current_output_plugin(); | |
420 | |
421 if (op == NULL) | |
422 return 0; | |
423 | |
424 return op->buffer_playing(); | |
425 } | |
426 | |
427 /* called by input plugin when data is ready */ | |
428 void | |
429 produce_audio(gint time, /* position */ | |
430 AFormat fmt, /* output format */ | |
431 gint nch, /* channels */ | |
432 gint length, /* length of sample */ | |
433 gpointer ptr, /* data */ | |
434 int *going /* 0 when time to stop */ | |
435 ) | |
436 { | |
437 static int init = 0; | |
438 int swapped = 0; | |
439 guint myorder = G_BYTE_ORDER == G_LITTLE_ENDIAN ? FMT_S16_LE : FMT_S16_BE; | |
440 int caneq = (fmt == FMT_S16_NE || fmt == myorder); | |
441 OutputPlugin *op = get_current_output_plugin(); | |
442 int writeoffs; | |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
443 AFormat new_format; |
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
444 gint new_rate; |
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
445 gint new_nch; |
2313 | 446 |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
447 #ifdef USE_SRC |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
448 if(src_state != NULL&&length > 0) |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
449 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
450 int lrLength = length/2; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
451 int overLrLength = (int)floor(lrLength*(src_data.src_ratio+1)); |
2648
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
452 if(lengthOfSrcIn < lrLength) |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
453 { |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
454 lengthOfSrcIn = lrLength; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
455 free(srcIn); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
456 srcIn = (float*)malloc(sizeof(float)*lrLength); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
457 } |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
458 if(lengthOfSrcOut < overLrLength) |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
459 { |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
460 lengthOfSrcOut = overLrLength; |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
461 free(srcOut); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
462 free(wOut); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
463 srcOut = (float*)malloc(sizeof(float)*overLrLength); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
464 wOut = (short int*)malloc(sizeof(short int)*overLrLength); |
51495131e4ae
[svn] - synchronize SRC conversion patch with upstream
nenolod
parents:
2542
diff
changeset
|
465 } |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
466 src_short_to_float_array((short int*)ptr, srcIn, lrLength); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
467 src_data.data_in = srcIn; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
468 src_data.data_out = srcOut; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
469 src_data.end_of_input = 0; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
470 src_data.input_frames = lrLength/2; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
471 src_data.output_frames = overLrLength/2; |
2542 | 472 if ((srcError = src_process(src_state, &src_data)) > 0) |
2538
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
473 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
474 fprintf(stderr, "src_process(): %s\n", src_strerror(srcError)); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
475 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
476 else |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
477 { |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
478 src_float_to_short_array(srcOut, wOut, src_data.output_frames_gen*2); |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
479 ptr = wOut; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
480 length = src_data.output_frames_gen*4; |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
481 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
482 } |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
483 #endif |
719e0898ff3c
[svn] - Patch to use libsamplerate for high-quality interpolated upsampling,
nenolod
parents:
2373
diff
changeset
|
484 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
485 if (!caneq && cfg.equalizer_active) { /* wrong byte order */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
486 byteswap(length, ptr); /* so convert */ |
2313 | 487 ++swapped; |
488 ++caneq; | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
489 } /* can eq now, mark swapd */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
490 else if (caneq && !cfg.equalizer_active) /* right order but no eq */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
491 caneq = 0; /* so don't eq */ |
2313 | 492 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
493 if (caneq) { /* if eq enab */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
494 if (!init) { /* if first run */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
495 init_iir(); /* then init eq */ |
2313 | 496 ++init; |
497 } | |
498 | |
499 iir(&ptr, length, nch); | |
500 | |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
501 if (swapped) /* if was swapped */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
502 byteswap(length, ptr); /* swap back for output */ |
2313 | 503 } |
504 | |
505 /* do vis plugin(s) */ | |
506 input_add_vis_pcm(time, fmt, nch, length, ptr); | |
507 | |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
508 /* do effect plugin(s) */ |
3486
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
509 new_format = op_state.fmt; |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
510 new_rate = op_state.rate; |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
511 new_nch = op_state.nch; |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
512 |
3486
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
513 effect_do_query_format(&new_format, &new_rate, &new_nch); |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
514 |
3486
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
515 if (new_format != op_state.fmt || |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
516 new_rate != op_state.rate || |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
517 new_nch != op_state.nch) |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
518 { |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
519 /* |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
520 * The effect plugin changes the stream format. Reopen the |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
521 * audio device. |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
522 */ |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
523 if (!output_open_audio(new_format, new_rate, new_nch)) |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
524 return; |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
525 } |
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
526 |
3486
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
527 length = effect_do_mod_samples(&ptr, length, op_state.fmt, op_state.rate, |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
528 op_state.nch); |
2811
1c7ee5ed3a10
[svn] Move effect plugin handling into the main thread
ertzing
parents:
2717
diff
changeset
|
529 |
3546
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
530 if (cfg.software_volume_control) |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
531 volumecontrol_pad_audio(ptr, length, op_state.fmt, op_state.nch); |
fd4cd1945b91
Connect volumecontrol flow to the work pipeline.
William Pitcock <nenolod@atheme.org>
parents:
3486
diff
changeset
|
532 |
2313 | 533 writeoffs = 0; |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
534 while (writeoffs < length) |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
535 { |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
536 int writable = length - writeoffs; |
2313 | 537 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
538 if (writable > 2048) |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
539 writable = 2048; |
2313 | 540 |
2813
49f3d1b43518
[svn] - code cleanups involving SRC patch and indentation
nenolod
parents:
2811
diff
changeset
|
541 if (writable == 0) |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
542 return; |
2313 | 543 |
3486
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
544 while (op->buffer_free() < writable) /* wait output buf */ |
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
545 { |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
546 if (going && !*going) /* thread stopped? */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
547 return; /* so finish */ |
2313 | 548 |
3486
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
549 if (ip_data.stop) /* has a stop been requested? */ |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
550 return; /* yes, so finish */ |
2313 | 551 |
3486
96baf555b449
Get rid of "XMMS Multiple Effect Plugin support" hack. Effects processing is handled in produce_audio() now days.
William Pitcock <nenolod@atheme.org>
parents:
3437
diff
changeset
|
552 g_usleep(10000); /* else sleep for retry */ |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
553 } |
2313 | 554 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
555 if (ip_data.stop) |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
556 return; |
2313 | 557 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
558 if (going && !*going) /* thread stopped? */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
559 return; /* so finish */ |
2313 | 560 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
561 /* do output */ |
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
562 op->write_audio(((guint8 *) ptr) + writeoffs, writable); |
2313 | 563 |
2373
ad1d7687814c
[svn] made strings.h for existing strings.c, cleanups
mf0102
parents:
2328
diff
changeset
|
564 writeoffs += writable; |
2313 | 565 } |
566 } |