]> git.wh0rd.org Git - patches.git/blob - uclinux-vplay-mixer.patch
scummvm random work
[patches.git] / uclinux-vplay-mixer.patch
1 --- uClinux/user/vplay/mixer.c
2 +++ uClinux/user/vplay/mixer.c
3 @@ -10,8 +10,11 @@
4   */
5  
6  #include <stdio.h>
7 +#include <stdlib.h>
8  #include <fcntl.h>
9  #include <string.h>
10 +#include <unistd.h>
11 +#include <sys/ioctl.h>
12  #include <linux/soundcard.h>
13  
14  char *names[SOUND_MIXER_NRDEVICES] = SOUND_DEVICE_NAMES;
15 @@ -105,6 +108,8 @@ main(int argc, char *argv[])
16         for (foo = 0; foo < SOUND_MIXER_NRDEVICES && strcmp(names[foo], argv[1]); foo++);
17  
18         if (foo >= SOUND_MIXER_NRDEVICES) {
19 +               if (argc <= 2)
20 +                       usage();
21  
22                 if (!strcmp("+rec", argv[1]) || !strcmp("-rec", argv[1])) {
23                         for (dev = 0; dev < SOUND_MIXER_NRDEVICES && strcmp(names[dev], argv[2]); dev++);
24 @@ -159,4 +164,5 @@ main(int argc, char *argv[])
25         }
26  
27         close(baz);
28 +       return 0;
29  }