annotate libao2/audio_out.c @ 15039:c9e2d75a9013

added support for mpa layers 1 and 2
author nicodvb
date Sat, 02 Apr 2005 10:30:19 +0000
parents 21e72b6d8d11
children f48dc20c9185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
1 #include <stdio.h>
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
2 #include <stdlib.h>
7848
3c1d30a1afc0 compiler warning fixes by Dominik
arpi
parents: 7609
diff changeset
3 #include <string.h>
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
4
14123
a92101a7eb49 Make include paths consistent.
diego
parents: 13878
diff changeset
5 #include "config.h"
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
6 #include "audio_out.h"
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
7
14123
a92101a7eb49 Make include paths consistent.
diego
parents: 13878
diff changeset
8 #include "mp_msg.h"
a92101a7eb49 Make include paths consistent.
diego
parents: 13878
diff changeset
9 #include "help_mp.h"
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
10
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
11 // there are some globals:
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 2900
diff changeset
12 ao_data_t ao_data={0,0,0,0,OUTBURST,-1,0};
1185
e21c96e28062 ao_subdevice implemented
al3x
parents: 1121
diff changeset
13 char *ao_subdevice = NULL;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
14
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
15 #ifdef USE_OSS_AUDIO
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
16 extern ao_functions_t audio_out_oss;
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
17 #endif
12792
0d9fe5027971 ao_macosx is fixed, moving it back to top
nplourde
parents: 12662
diff changeset
18 #ifdef MACOSX
0d9fe5027971 ao_macosx is fixed, moving it back to top
nplourde
parents: 12662
diff changeset
19 extern ao_functions_t audio_out_macosx;
0d9fe5027971 ao_macosx is fixed, moving it back to top
nplourde
parents: 12662
diff changeset
20 #endif
6214
0398cb49fe5e aRts audio out support by Michele Balistreri <brain at email.it>
atmos4
parents: 6069
diff changeset
21 #ifdef USE_ARTS
0398cb49fe5e aRts audio out support by Michele Balistreri <brain at email.it>
atmos4
parents: 6069
diff changeset
22 extern ao_functions_t audio_out_arts;
0398cb49fe5e aRts audio out support by Michele Balistreri <brain at email.it>
atmos4
parents: 6069
diff changeset
23 #endif
8572
46dbfa8c1999 new EsounD audio driver (-ao esd)
jkeil
parents: 7916
diff changeset
24 #ifdef USE_ESD
46dbfa8c1999 new EsounD audio driver (-ao esd)
jkeil
parents: 7916
diff changeset
25 extern ao_functions_t audio_out_esd;
46dbfa8c1999 new EsounD audio driver (-ao esd)
jkeil
parents: 7916
diff changeset
26 #endif
13878
66637fa67531 polyaudio audio driver patch by Lennart Poettering <mzzcynlre at 0pointer.de>
faust3
parents: 13632
diff changeset
27 #ifdef USE_POLYP
66637fa67531 polyaudio audio driver patch by Lennart Poettering <mzzcynlre at 0pointer.de>
faust3
parents: 13632
diff changeset
28 extern ao_functions_t audio_out_polyp;
66637fa67531 polyaudio audio driver patch by Lennart Poettering <mzzcynlre at 0pointer.de>
faust3
parents: 13632
diff changeset
29 #endif
12662
05d46af5e2bf JACK audio support through bio2jack by Kamil Strzelecki <esack@o2.pl>
alex
parents: 12636
diff changeset
30 #ifdef USE_JACK
05d46af5e2bf JACK audio support through bio2jack by Kamil Strzelecki <esack@o2.pl>
alex
parents: 12636
diff changeset
31 extern ao_functions_t audio_out_jack;
05d46af5e2bf JACK audio support through bio2jack by Kamil Strzelecki <esack@o2.pl>
alex
parents: 12636
diff changeset
32 #endif
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
33 extern ao_functions_t audio_out_null;
1007
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
34 #ifdef HAVE_ALSA5
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
35 extern ao_functions_t audio_out_alsa5;
e2de3386725f fixed HAVE_ALSA5 var. bug. sorry :(
pontscho
parents: 995
diff changeset
36 #endif
1032
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
37 #ifdef HAVE_ALSA9
12462
38f523e2c3ba changes for alsa9/1.x-merge only alsa
joyping
parents: 11775
diff changeset
38 extern ao_functions_t audio_out_alsa;
1032
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
39 #endif
11775
66e491c35dc8 ALSA 1.x audio out driver
henry
parents: 10147
diff changeset
40 #ifdef HAVE_ALSA1X
12462
38f523e2c3ba changes for alsa9/1.x-merge only alsa
joyping
parents: 11775
diff changeset
41 extern ao_functions_t audio_out_alsa;
11775
66e491c35dc8 ALSA 1.x audio out driver
henry
parents: 10147
diff changeset
42 #endif
3276
e279cc05f189 -ao NAS support by Tobias Diedrich <ranma@gmx.at>
arpi
parents: 3095
diff changeset
43 #ifdef HAVE_NAS
e279cc05f189 -ao NAS support by Tobias Diedrich <ranma@gmx.at>
arpi
parents: 3095
diff changeset
44 extern ao_functions_t audio_out_nas;
e279cc05f189 -ao NAS support by Tobias Diedrich <ranma@gmx.at>
arpi
parents: 3095
diff changeset
45 #endif
966
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
46 #ifdef HAVE_SDL
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
47 extern ao_functions_t audio_out_sdl;
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
48 #endif
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
49 #ifdef USE_SUN_AUDIO
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
50 extern ao_functions_t audio_out_sun;
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
51 #endif
2450
f51307170f69 MIPS support by oliver.schoenbrunner@jku.at
arpi
parents: 1725
diff changeset
52 #ifdef USE_SGI_AUDIO
f51307170f69 MIPS support by oliver.schoenbrunner@jku.at
arpi
parents: 1725
diff changeset
53 extern ao_functions_t audio_out_sgi;
f51307170f69 MIPS support by oliver.schoenbrunner@jku.at
arpi
parents: 1725
diff changeset
54 #endif
7916
01198a05d97c add ao_win32
faust3
parents: 7848
diff changeset
55 #ifdef HAVE_WIN32WAVEOUT
01198a05d97c add ao_win32
faust3
parents: 7848
diff changeset
56 extern ao_functions_t audio_out_win32;
01198a05d97c add ao_win32
faust3
parents: 7848
diff changeset
57 #endif
13460
70d8f1975fc8 directsound audio output plugin, patch by Gabor Szecsi <deje at miki.hu> some minor modifications by me
faust3
parents: 12792
diff changeset
58 #ifdef HAVE_DIRECTX
70d8f1975fc8 directsound audio output plugin, patch by Gabor Szecsi <deje at miki.hu> some minor modifications by me
faust3
parents: 12792
diff changeset
59 extern ao_functions_t audio_out_dsound;
70d8f1975fc8 directsound audio output plugin, patch by Gabor Szecsi <deje at miki.hu> some minor modifications by me
faust3
parents: 12792
diff changeset
60 #endif
6069
8e88e92fe331 Initial support for dxr2. Based on patch from Tobias Diedrich <ranma@gmx.at>.
albeu
parents: 5192
diff changeset
61 #ifdef HAVE_DXR2
8e88e92fe331 Initial support for dxr2. Based on patch from Tobias Diedrich <ranma@gmx.at>.
albeu
parents: 5192
diff changeset
62 extern ao_functions_t audio_out_dxr2;
8e88e92fe331 Initial support for dxr2. Based on patch from Tobias Diedrich <ranma@gmx.at>.
albeu
parents: 5192
diff changeset
63 #endif
4788
d678ce495a75 Moved HW dependent mixer stuff to libao and removed master switch
anders
parents: 4097
diff changeset
64 extern ao_functions_t audio_out_mpegpes;
1107
9d764880d989 Added raw PCM writer ao driver.
atmosfear
parents: 1058
diff changeset
65 extern ao_functions_t audio_out_pcm;
1185
e21c96e28062 ao_subdevice implemented
al3x
parents: 1121
diff changeset
66 extern ao_functions_t audio_out_pss;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
67
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
68 ao_functions_t* audio_out_drivers[] =
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
69 {
7609
arpi
parents: 7563
diff changeset
70 // vo-related: will fail unless you also do -vo mpegpes/dxr2
arpi
parents: 7563
diff changeset
71 &audio_out_mpegpes,
arpi
parents: 7563
diff changeset
72 #ifdef HAVE_DXR2
arpi
parents: 7563
diff changeset
73 &audio_out_dxr2,
arpi
parents: 7563
diff changeset
74 #endif
arpi
parents: 7563
diff changeset
75 // native:
13460
70d8f1975fc8 directsound audio output plugin, patch by Gabor Szecsi <deje at miki.hu> some minor modifications by me
faust3
parents: 12792
diff changeset
76 #ifdef HAVE_DIRECTX
70d8f1975fc8 directsound audio output plugin, patch by Gabor Szecsi <deje at miki.hu> some minor modifications by me
faust3
parents: 12792
diff changeset
77 &audio_out_dsound,
70d8f1975fc8 directsound audio output plugin, patch by Gabor Szecsi <deje at miki.hu> some minor modifications by me
faust3
parents: 12792
diff changeset
78 #endif
8729
561aa9c850f7 Rearrange the vo and ao driver order to prefer the native drivers and give
diego
parents: 8572
diff changeset
79 #ifdef HAVE_WIN32WAVEOUT
561aa9c850f7 Rearrange the vo and ao driver order to prefer the native drivers and give
diego
parents: 8572
diff changeset
80 &audio_out_win32,
561aa9c850f7 Rearrange the vo and ao driver order to prefer the native drivers and give
diego
parents: 8572
diff changeset
81 #endif
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
82 #ifdef USE_OSS_AUDIO
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
83 &audio_out_oss,
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1032
diff changeset
84 #endif
11775
66e491c35dc8 ALSA 1.x audio out driver
henry
parents: 10147
diff changeset
85 #ifdef HAVE_ALSA1X
12462
38f523e2c3ba changes for alsa9/1.x-merge only alsa
joyping
parents: 11775
diff changeset
86 &audio_out_alsa,
11775
66e491c35dc8 ALSA 1.x audio out driver
henry
parents: 10147
diff changeset
87 #endif
7609
arpi
parents: 7563
diff changeset
88 #ifdef HAVE_ALSA9
12462
38f523e2c3ba changes for alsa9/1.x-merge only alsa
joyping
parents: 11775
diff changeset
89 &audio_out_alsa,
6214
0398cb49fe5e aRts audio out support by Michele Balistreri <brain at email.it>
atmos4
parents: 6069
diff changeset
90 #endif
7609
arpi
parents: 7563
diff changeset
91 #ifdef HAVE_ALSA5
arpi
parents: 7563
diff changeset
92 &audio_out_alsa5,
1725
24e75b632740 Move the sun audio driver near the start of the list of audio drivers, so
jkeil
parents: 1528
diff changeset
93 #endif
2450
f51307170f69 MIPS support by oliver.schoenbrunner@jku.at
arpi
parents: 1725
diff changeset
94 #ifdef USE_SGI_AUDIO
f51307170f69 MIPS support by oliver.schoenbrunner@jku.at
arpi
parents: 1725
diff changeset
95 &audio_out_sgi,
f51307170f69 MIPS support by oliver.schoenbrunner@jku.at
arpi
parents: 1725
diff changeset
96 #endif
7609
arpi
parents: 7563
diff changeset
97 #ifdef USE_SUN_AUDIO
arpi
parents: 7563
diff changeset
98 &audio_out_sun,
6069
8e88e92fe331 Initial support for dxr2. Based on patch from Tobias Diedrich <ranma@gmx.at>.
albeu
parents: 5192
diff changeset
99 #endif
7609
arpi
parents: 7563
diff changeset
100 // wrappers:
arpi
parents: 7563
diff changeset
101 #ifdef USE_ARTS
arpi
parents: 7563
diff changeset
102 &audio_out_arts,
1032
e34336f4feaf add esd support and disabled default.
pontscho
parents: 1007
diff changeset
103 #endif
8572
46dbfa8c1999 new EsounD audio driver (-ao esd)
jkeil
parents: 7916
diff changeset
104 #ifdef USE_ESD
46dbfa8c1999 new EsounD audio driver (-ao esd)
jkeil
parents: 7916
diff changeset
105 &audio_out_esd,
46dbfa8c1999 new EsounD audio driver (-ao esd)
jkeil
parents: 7916
diff changeset
106 #endif
13878
66637fa67531 polyaudio audio driver patch by Lennart Poettering <mzzcynlre at 0pointer.de>
faust3
parents: 13632
diff changeset
107 #ifdef USE_POLYP
66637fa67531 polyaudio audio driver patch by Lennart Poettering <mzzcynlre at 0pointer.de>
faust3
parents: 13632
diff changeset
108 &audio_out_polyp,
66637fa67531 polyaudio audio driver patch by Lennart Poettering <mzzcynlre at 0pointer.de>
faust3
parents: 13632
diff changeset
109 #endif
12662
05d46af5e2bf JACK audio support through bio2jack by Kamil Strzelecki <esack@o2.pl>
alex
parents: 12636
diff changeset
110 #ifdef USE_JACK
05d46af5e2bf JACK audio support through bio2jack by Kamil Strzelecki <esack@o2.pl>
alex
parents: 12636
diff changeset
111 &audio_out_jack,
05d46af5e2bf JACK audio support through bio2jack by Kamil Strzelecki <esack@o2.pl>
alex
parents: 12636
diff changeset
112 #endif
3276
e279cc05f189 -ao NAS support by Tobias Diedrich <ranma@gmx.at>
arpi
parents: 3095
diff changeset
113 #ifdef HAVE_NAS
e279cc05f189 -ao NAS support by Tobias Diedrich <ranma@gmx.at>
arpi
parents: 3095
diff changeset
114 &audio_out_nas,
e279cc05f189 -ao NAS support by Tobias Diedrich <ranma@gmx.at>
arpi
parents: 3095
diff changeset
115 #endif
966
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
116 #ifdef HAVE_SDL
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
117 &audio_out_sdl,
69b4f944ce08 Added support for sdl audio out (buggy pre-alpha).
atmosfear
parents: 954
diff changeset
118 #endif
12636
58dca847caa0 move macosx in the priority list after sdl, patch by Dan Christiansen
alex
parents: 12462
diff changeset
119 #ifdef MACOSX
58dca847caa0 move macosx in the priority list after sdl, patch by Dan Christiansen
alex
parents: 12462
diff changeset
120 &audio_out_macosx,
58dca847caa0 move macosx in the priority list after sdl, patch by Dan Christiansen
alex
parents: 12462
diff changeset
121 #endif
7609
arpi
parents: 7563
diff changeset
122 &audio_out_null,
arpi
parents: 7563
diff changeset
123 // should not be auto-selected:
1107
9d764880d989 Added raw PCM writer ao driver.
atmosfear
parents: 1058
diff changeset
124 &audio_out_pcm,
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
125 NULL
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
126 };
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 2900
diff changeset
127
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
128 void list_audio_out(){
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
129 int i=0;
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
130 mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AvailableAudioOutputDrivers);
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
131 while (audio_out_drivers[i]) {
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
132 const ao_info_t *info = audio_out_drivers[i++]->info;
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
133 printf("\t%s\t%s\n", info->short_name, info->name);
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
134 }
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
135 printf("\n");
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
136 }
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 2900
diff changeset
137
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
138 ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate,int channels,int format,int flags){
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
139 int i;
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
140 // first try the preferred drivers, with their optional subdevice param:
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
141 if(ao_list && ao_list[0])
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
142 while(ao_list[0][0]){
13632
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
143 char* ao=ao_list[0];
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
144 int ao_len;
13542
ed7e91827ead removing ao_alsa9.c and ao_alsa1x.c as they are superseded by ao_alsa.c
reimar
parents: 13520
diff changeset
145 if (strncmp(ao, "alsa9", 5) == 0 || strncmp(ao, "alsa1x", 6) == 0) {
ed7e91827ead removing ao_alsa9.c and ao_alsa1x.c as they are superseded by ao_alsa.c
reimar
parents: 13520
diff changeset
146 mp_msg(MSGT_AO, MSGL_FATAL, MSGTR_AO_ALSA9_1x_Removed);
ed7e91827ead removing ao_alsa9.c and ao_alsa1x.c as they are superseded by ao_alsa.c
reimar
parents: 13520
diff changeset
147 exit_player(NULL);
ed7e91827ead removing ao_alsa9.c and ao_alsa1x.c as they are superseded by ao_alsa.c
reimar
parents: 13520
diff changeset
148 }
13632
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
149 if (ao_subdevice) {
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
150 free(ao_subdevice);
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
151 ao_subdevice = NULL;
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
152 }
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
153 ao_subdevice=strchr(ao,':');
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
154 if(ao_subdevice){
13632
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
155 ao_len = ao_subdevice - ao;
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
156 ao_subdevice = strdup(&ao[ao_len + 1]);
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
157 }
13632
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
158 else
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
159 ao_len = strlen(ao);
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
160 for(i=0;audio_out_drivers[i];i++){
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
161 ao_functions_t* audio_out=audio_out_drivers[i];
13632
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
162 if(!strncmp(audio_out->info->short_name,ao,ao_len)){
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
163 // name matches, try it
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
164 if(audio_out->init(rate,channels,format,flags))
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
165 return audio_out; // success!
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
166 }
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
167 }
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
168 // continue...
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
169 ++ao_list;
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
170 if(!(ao_list[0])) return NULL; // do NOT fallback to others
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
171 }
13632
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
172 if (ao_subdevice) {
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
173 free(ao_subdevice);
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
174 ao_subdevice = NULL;
b633ce0aa5c5 fixed small memleaks
reimar
parents: 13542
diff changeset
175 }
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
176 // now try the rest...
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
177 for(i=0;audio_out_drivers[i];i++){
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
178 ao_functions_t* audio_out=audio_out_drivers[i];
14245
815f03b7cee5 removing AFMT_ dependancy
alex
parents: 14123
diff changeset
179 // if(audio_out->control(AOCONTROL_QUERY_FORMAT, (int)format) == CONTROL_TRUE)
7563
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
180 if(audio_out->init(rate,channels,format,flags))
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
181 return audio_out; // success!
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
182 }
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
183 return NULL;
e9e4398029de audio out driver list support (example: -ao alsa9,sdl:esd,oss,sdl:oss,)
arpi
parents: 6214
diff changeset
184 }
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 2900
diff changeset
185