|
12 | 12 | * You should have received a copy of the GNU General Public License along with RetroArch. |
13 | 13 | * If not, see <http://www.gnu.org/licenses/>. |
14 | 14 | */ |
15 | | - |
| 15 | +#pragma GCC diagnostic push |
| 16 | +#pragma GCC diagnostic ignored "-Wpedantic" |
16 | 17 | #include <spa/param/audio/format-utils.h> |
17 | 18 | #include <spa/utils/ringbuffer.h> |
18 | 19 | #include <spa/utils/result.h> |
19 | 20 | #include <spa/param/props.h> |
20 | 21 | #include <pipewire/pipewire.h> |
| 22 | +#pragma GCC diagnostic pop |
21 | 23 |
|
22 | 24 | #include <boolean.h> |
23 | 25 | #include <retro_miscellaneous.h> |
@@ -132,12 +134,16 @@ static void pwire_capture_process_cb(void *data) |
132 | 134 | if (!(b = pw_stream_dequeue_buffer(mic->stream))) |
133 | 135 | { |
134 | 136 | RARCH_ERR("[Microphone] [PipeWire] Out of buffers: %s.\n", strerror(errno)); |
135 | | - return pw_thread_loop_signal(mic->pw->thread_loop, false); |
| 137 | + pw_thread_loop_signal(mic->pw->thread_loop, false); |
| 138 | + return; |
136 | 139 | } |
137 | 140 |
|
138 | 141 | buf = b->buffer; |
139 | 142 | if ((p = buf->datas[0].data) == NULL) |
140 | | - return pw_thread_loop_signal(mic->pw->thread_loop, false); |
| 143 | + { |
| 144 | + pw_thread_loop_signal(mic->pw->thread_loop, false); |
| 145 | + return; |
| 146 | + } |
141 | 147 |
|
142 | 148 | offs = MIN(buf->datas[0].chunk->offset, buf->datas[0].maxsize); |
143 | 149 | n_bytes = MIN(buf->datas[0].chunk->size, buf->datas[0].maxsize - offs); |
@@ -216,8 +222,10 @@ static void *pwire_microphone_init(void) |
216 | 222 | struct pw_properties *props = NULL; |
217 | 223 | const char *error = NULL; |
218 | 224 | pipewire_core_t *pw = NULL; |
| 225 | +#pragma GCC diagnostic push |
| 226 | +#pragma GCC diagnostic ignored "-Wpedantic" |
219 | 227 | struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); |
220 | | - |
| 228 | +#pragma GCC diagnostic pop |
221 | 229 | if (!pipewire_core_init(&pw, "microphone_driver", &pwire_mic_registry_events)) |
222 | 230 | goto error; |
223 | 231 |
|
@@ -336,7 +344,10 @@ static void *pwire_microphone_open_mic(void *driver_context, |
336 | 344 | const struct spa_pod *params[1]; |
337 | 345 | struct pw_properties *props = NULL; |
338 | 346 | const char *error = NULL; |
| 347 | +#pragma GCC diagnostic push |
| 348 | +#pragma GCC diagnostic ignored "-Wpedantic" |
339 | 349 | struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); |
| 350 | +#pragma GCC diagnostic pop |
340 | 351 | pipewire_microphone_t *mic = NULL; |
341 | 352 |
|
342 | 353 | if (!driver_context || (mic = calloc(1, sizeof(pipewire_microphone_t))) == NULL) |
@@ -494,12 +505,16 @@ static void pwire_playback_process_cb(void *data) |
494 | 505 | if ((b = pw_stream_dequeue_buffer(audio->stream)) == NULL) |
495 | 506 | { |
496 | 507 | RARCH_WARN("[PipeWire] Out of buffers: %s.\n", strerror(errno)); |
497 | | - return pw_thread_loop_signal(audio->pw->thread_loop, false); |
| 508 | + pw_thread_loop_signal(audio->pw->thread_loop, false); |
| 509 | + return; |
498 | 510 | } |
499 | 511 |
|
500 | 512 | buf = b->buffer; |
501 | 513 | if ((p = buf->datas[0].data) == NULL) |
502 | | - return pw_thread_loop_signal(audio->pw->thread_loop, false); |
| 514 | + { |
| 515 | + pw_thread_loop_signal(audio->pw->thread_loop, false); |
| 516 | + return; |
| 517 | + } |
503 | 518 |
|
504 | 519 | /* calculate the total no of bytes to read data from buffer */ |
505 | 520 | n_bytes = buf->datas[0].maxsize; |
@@ -596,7 +611,10 @@ static void *pwire_init(const char *device, unsigned rate, |
596 | 611 | struct pw_properties *props = NULL; |
597 | 612 | const char *error = NULL; |
598 | 613 | pipewire_audio_t *audio = (pipewire_audio_t*)calloc(1, sizeof(*audio)); |
| 614 | +#pragma GCC diagnostic push |
| 615 | +#pragma GCC diagnostic ignored "-Wpedantic" |
599 | 616 | struct spa_pod_builder b = SPA_POD_BUILDER_INIT(buffer, sizeof(buffer)); |
| 617 | +#pragma GCC diagnostic pop |
600 | 618 |
|
601 | 619 | if (!audio) |
602 | 620 | return NULL; |
|
0 commit comments