gfx stack update (still holding the breaking llvm)
[nyanlinux.git] / builders / alsa-utils-1.2.7 / aplay.patch
blob5dbb3e7b09efbdcb514b4d1869e747fc782f8c20
1 --- a/aplay/aplay.orig.c
2 +++ b/aplay/aplay.c
3 @@ -41,7 +41,9 @@
4 #include <time.h>
5 #include <locale.h>
6 #include <alsa/asoundlib.h>
7 +#ifdef HAVE_ALSA_USE_CASE_H
8 #include <alsa/use-case.h>
9 +#endif
10 #include <assert.h>
11 #include <termios.h>
12 #include <signal.h>
13 @@ -453,6 +455,7 @@
14 return offset;
17 +#ifdef HAVE_ALSA_USE_CASE_H
18 static int open_ucm(snd_use_case_mgr_t **uc_mgr, char **pcm_name, const char *name)
20 char *s, *p;
21 @@ -476,6 +479,7 @@
23 return err;
25 +#endif
27 static long parse_long(const char *str, int *err)
29 @@ -553,7 +557,9 @@
30 int do_device_list = 0, do_pcm_list = 0, force_sample_format = 0;
31 snd_pcm_info_t *info;
32 FILE *direction;
33 +#ifdef HAVE_ALSA_USE_CASE_H
34 snd_use_case_mgr_t *uc_mgr = NULL;
35 +#endif
37 #ifdef ENABLE_NLS
38 setlocale(LC_ALL, "");
39 @@ -852,6 +858,7 @@
40 goto __end;
43 +#ifdef HAVE_ALSA_USE_CASE_H
44 if (strncmp(pcm_name, "ucm.", 4) == 0) {
45 err = open_ucm(&uc_mgr, &pcm_name, pcm_name + 4);
46 if (err < 0) {
47 @@ -861,6 +868,7 @@
48 if (verbose)
49 fprintf(stderr, _("Found UCM PCM device: %s\n"), pcm_name);
51 +#endif
53 err = snd_pcm_open(&handle, pcm_name, stream, open_mode);
54 if (err < 0) {
55 @@ -951,8 +959,10 @@
56 if (verbose==2)
57 putchar('\n');
58 snd_pcm_close(handle);
59 +#ifdef HAVE_ALSA_USE_CASE_H
60 if (uc_mgr)
61 snd_use_case_mgr_close(uc_mgr);
62 +#endif
63 handle = NULL;
64 free(audiobuf);
65 __end: