1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2006 Christian Schoenebeck * |
* Copyright (C) 2006 - 2020 Christian Schoenebeck * |
4 |
* * |
* * |
5 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
169 |
* Entry point for the thread. |
* Entry point for the thread. |
170 |
*/ |
*/ |
171 |
int AudioOutputDeviceArts::Main() { |
int AudioOutputDeviceArts::Main() { |
172 |
|
|
173 |
|
#if DEBUG |
174 |
|
Thread::setNameOfCaller("ArtsAudio"); |
175 |
|
#endif |
176 |
|
|
177 |
while (true) { |
while (true) { |
178 |
|
TestCancel(); |
179 |
|
|
180 |
|
// prevent thread from being cancelled |
181 |
|
// (e.g. to prevent deadlocks while holding mutex lock(s)) |
182 |
|
pushCancelable(false); |
183 |
|
|
184 |
// let all connected engines render 'FragmentSize' sample points |
// let all connected engines render 'FragmentSize' sample points |
185 |
RenderAudio(FragmentSize); |
RenderAudio(FragmentSize); |
202 |
fprintf(stderr, "AudioOutputDeviceArts: Audio output error, exiting.\n"); |
fprintf(stderr, "AudioOutputDeviceArts: Audio output error, exiting.\n"); |
203 |
exit(EXIT_FAILURE); |
exit(EXIT_FAILURE); |
204 |
} |
} |
205 |
|
|
206 |
|
// now allow thread being cancelled again |
207 |
|
// (since all mutexes are now unlocked) |
208 |
|
popCancelable(); |
209 |
} |
} |
210 |
} |
} |
211 |
|
|