test/testmultiaudio.c
changeset 2867 eec7adc3d1c5
parent 2146 9fcde304c7b6
child 3099 82e60908fab1
equal deleted inserted replaced
2866:e532417a6977 2867:eec7adc3d1c5
    51         printf("playing on device #%d: ('%s')...", i, devname);
    51         printf("playing on device #%d: ('%s')...", i, devname);
    52         fflush(stdout);
    52         fflush(stdout);
    53 
    53 
    54         SDL_memset(&cbd[0], '\0', sizeof(callback_data));
    54         SDL_memset(&cbd[0], '\0', sizeof(callback_data));
    55         spec.userdata = &cbd[0];
    55         spec.userdata = &cbd[0];
    56         cbd[0].dev = SDL_OpenAudioDevice(devname, 0, &spec, NULL);
    56         cbd[0].dev = SDL_OpenAudioDevice(devname, 0, &spec, NULL, 0);
    57         if (cbd[0].dev == 0) {
    57         if (cbd[0].dev == 0) {
    58             printf("Open device failed: %s\n", SDL_GetError());
    58             printf("Open device failed: %s\n", SDL_GetError());
    59         } else {
    59         } else {
    60             SDL_PauseAudioDevice(cbd[0].dev, 0);
    60             SDL_PauseAudioDevice(cbd[0].dev, 0);
    61             while (!cbd[0].done)
    61             while (!cbd[0].done)
    70 
    70 
    71     printf("playing on all devices...\n");
    71     printf("playing on all devices...\n");
    72     for (i = 0; i < devcount; i++) {
    72     for (i = 0; i < devcount; i++) {
    73         const char *devname = SDL_GetAudioDeviceName(i, 0);
    73         const char *devname = SDL_GetAudioDeviceName(i, 0);
    74         spec.userdata = &cbd[i];
    74         spec.userdata = &cbd[i];
    75         cbd[i].dev = SDL_OpenAudioDevice(devname, 0, &spec, NULL);
    75         cbd[i].dev = SDL_OpenAudioDevice(devname, 0, &spec, NULL, 0);
    76         if (cbd[i].dev == 0) {
    76         if (cbd[i].dev == 0) {
    77             printf("Open device %d failed: %s\n", i, SDL_GetError());
    77             printf("Open device %d failed: %s\n", i, SDL_GetError());
    78         }
    78         }
    79     }
    79     }
    80 
    80