Mercurial > mplayer.hg
annotate libao2/ao_pcm.c @ 28428:8df00b0c4f0d
We use libdvdcss 1.2.10, not 1.2.9.
author | diego |
---|---|
date | Wed, 04 Feb 2009 18:32:32 +0000 |
parents | e45b08f2f5d3 |
children | 9a5b8c2ed6de |
rev | line source |
---|---|
28343 | 1 /* |
2 * PCM audio output driver | |
3 * | |
4 * This file is part of MPlayer. | |
5 * | |
6 * MPlayer is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * MPlayer is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License along | |
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 */ | |
20 | |
6237 | 21 #include "config.h" |
22 | |
1107 | 23 #include <stdio.h> |
24 #include <stdlib.h> | |
6237 | 25 #include <string.h> |
1107 | 26 |
21372 | 27 #include "libavutil/common.h" |
21507
fa99b3d31d13
Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
reimar
parents:
21372
diff
changeset
|
28 #include "mpbswap.h" |
14298
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
29 #include "subopt-helper.h" |
14245 | 30 #include "libaf/af_format.h" |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
31 #include "libaf/reorder_ch.h" |
1107 | 32 #include "audio_out.h" |
33 #include "audio_out_internal.h" | |
14123 | 34 #include "mp_msg.h" |
35 #include "help_mp.h" | |
13383
c1955840883d
mp_msg transition of unmaintained audio output drivers.
ivo
parents:
12145
diff
changeset
|
36 |
1107 | 37 |
38 static ao_info_t info = | |
39 { | |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
40 "RAW PCM/WAVE file writer audio output", |
1107 | 41 "pcm", |
42 "Atmosfear", | |
43 "" | |
44 }; | |
45 | |
46 LIBAO_EXTERN(pcm) | |
47 | |
4914
de4074ab4e5f
good-looking fix by Tobias Diedrich <td@informatik.uni-hannover.de>
arpi
parents:
3095
diff
changeset
|
48 extern int vo_pts; |
de4074ab4e5f
good-looking fix by Tobias Diedrich <td@informatik.uni-hannover.de>
arpi
parents:
3095
diff
changeset
|
49 |
14298
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
50 static char *ao_outputfilename = NULL; |
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
51 static int ao_pcm_waveheader = 1; |
18092
96fdfbad5b1a
-ao pcm:fast suboption for faster-than-realtime dumping
reimar
parents:
17566
diff
changeset
|
52 static int fast = 0; |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
53 |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
54 #define WAV_ID_RIFF 0x46464952 /* "RIFF" */ |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
55 #define WAV_ID_WAVE 0x45564157 /* "WAVE" */ |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
56 #define WAV_ID_FMT 0x20746d66 /* "fmt " */ |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
57 #define WAV_ID_DATA 0x61746164 /* "data" */ |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
58 #define WAV_ID_PCM 0x0001 |
26604
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
59 #define WAV_ID_FLOAT_PCM 0x0003 |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
60 |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
61 struct WaveHeader |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
62 { |
11270 | 63 uint32_t riff; |
64 uint32_t file_length; | |
65 uint32_t wave; | |
66 uint32_t fmt; | |
67 uint32_t fmt_length; | |
68 uint16_t fmt_tag; | |
69 uint16_t channels; | |
70 uint32_t sample_rate; | |
71 uint32_t bytes_per_second; | |
72 uint16_t block_align; | |
73 uint16_t bits; | |
74 uint32_t data; | |
75 uint32_t data_length; | |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
76 }; |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
77 |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
78 /* init with default values */ |
21250
7b1ab00ef2eb
le2me_32 is no longer a macro on PPC, and in general does not have to
reimar
parents:
18500
diff
changeset
|
79 static struct WaveHeader wavhdr; |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
80 |
1107 | 81 static FILE *fp = NULL; |
82 | |
83 // to set/get/query special features/parameters | |
9633
12b1790038b0
64bit libao2 fix by Jens Axboe <mplayer-dev@kernel.dk>
alex
parents:
9277
diff
changeset
|
84 static int control(int cmd,void *arg){ |
1107 | 85 return -1; |
86 } | |
87 | |
88 // open & setup audio device | |
89 // return: 1=success 0=fail | |
90 static int init(int rate,int channels,int format,int flags){ | |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
91 int bits; |
14298
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
92 opt_t subopts[] = { |
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
93 {"waveheader", OPT_ARG_BOOL, &ao_pcm_waveheader, NULL}, |
14539 | 94 {"file", OPT_ARG_MSTRZ, &ao_outputfilename, NULL}, |
18092
96fdfbad5b1a
-ao pcm:fast suboption for faster-than-realtime dumping
reimar
parents:
17566
diff
changeset
|
95 {"fast", OPT_ARG_BOOL, &fast, NULL}, |
14298
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
96 {NULL} |
14300 | 97 }; |
14298
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
98 // set defaults |
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
99 ao_pcm_waveheader = 1; |
18488
b23c0e341e3e
Move setting the output filename after the suboption parsing, otherwise it
diego
parents:
18092
diff
changeset
|
100 |
14298
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
101 if (subopt_parse(ao_subdevice, subopts) != 0) { |
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
102 return 0; |
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
103 } |
18500
9533f21d3f7e
Only set the default output filename when it was not passed on the command
diego
parents:
18488
diff
changeset
|
104 if (!ao_outputfilename){ |
9533f21d3f7e
Only set the default output filename when it was not passed on the command
diego
parents:
18488
diff
changeset
|
105 ao_outputfilename = |
9533f21d3f7e
Only set the default output filename when it was not passed on the command
diego
parents:
18488
diff
changeset
|
106 strdup(ao_pcm_waveheader?"audiodump.wav":"audiodump.pcm"); |
9533f21d3f7e
Only set the default output filename when it was not passed on the command
diego
parents:
18488
diff
changeset
|
107 } |
18488
b23c0e341e3e
Move setting the output filename after the suboption parsing, otherwise it
diego
parents:
18092
diff
changeset
|
108 |
7658 | 109 bits=8; |
110 switch(format){ | |
26604
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
111 case AF_FORMAT_S32_BE: |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
112 format=AF_FORMAT_S32_LE; |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
113 case AF_FORMAT_S32_LE: |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
114 bits=32; |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
115 break; |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
116 case AF_FORMAT_FLOAT_BE: |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
117 format=AF_FORMAT_FLOAT_LE; |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
118 case AF_FORMAT_FLOAT_LE: |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
119 bits=32; |
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
120 break; |
14245 | 121 case AF_FORMAT_S8: |
122 format=AF_FORMAT_U8; | |
123 case AF_FORMAT_U8: | |
7658 | 124 break; |
25097 | 125 case AF_FORMAT_AC3: |
126 bits=16; | |
127 break; | |
7658 | 128 default: |
14245 | 129 format=AF_FORMAT_S16_LE; |
7658 | 130 bits=16; |
131 break; | |
132 } | |
133 | |
134 ao_data.outburst = 65536; | |
135 ao_data.buffersize= 2*65536; | |
136 ao_data.channels=channels; | |
137 ao_data.samplerate=rate; | |
138 ao_data.format=format; | |
139 ao_data.bps=channels*rate*(bits/8); | |
140 | |
21250
7b1ab00ef2eb
le2me_32 is no longer a macro on PPC, and in general does not have to
reimar
parents:
18500
diff
changeset
|
141 wavhdr.riff = le2me_32(WAV_ID_RIFF); |
7b1ab00ef2eb
le2me_32 is no longer a macro on PPC, and in general does not have to
reimar
parents:
18500
diff
changeset
|
142 wavhdr.wave = le2me_32(WAV_ID_WAVE); |
7b1ab00ef2eb
le2me_32 is no longer a macro on PPC, and in general does not have to
reimar
parents:
18500
diff
changeset
|
143 wavhdr.fmt = le2me_32(WAV_ID_FMT); |
7b1ab00ef2eb
le2me_32 is no longer a macro on PPC, and in general does not have to
reimar
parents:
18500
diff
changeset
|
144 wavhdr.fmt_length = le2me_32(16); |
26604
9946e4a6e457
Support 32 bit float and integer formats in ao_pcm.c
reimar
parents:
25315
diff
changeset
|
145 wavhdr.fmt_tag = le2me_16(format == AF_FORMAT_FLOAT_LE ? WAV_ID_FLOAT_PCM : WAV_ID_PCM); |
7658 | 146 wavhdr.channels = le2me_16(ao_data.channels); |
147 wavhdr.sample_rate = le2me_32(ao_data.samplerate); | |
148 wavhdr.bytes_per_second = le2me_32(ao_data.bps); | |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
149 wavhdr.bits = le2me_16(bits); |
16243
178b8b4a62c6
Set block_align in header, seems MatLab can not handle files without.
reimar
parents:
14539
diff
changeset
|
150 wavhdr.block_align = le2me_16(ao_data.channels * (bits / 8)); |
9277
d824f1a3c341
The "initialize wav header with infinite lenght" broke the
arpi
parents:
9223
diff
changeset
|
151 |
21250
7b1ab00ef2eb
le2me_32 is no longer a macro on PPC, and in general does not have to
reimar
parents:
18500
diff
changeset
|
152 wavhdr.data = le2me_32(WAV_ID_DATA); |
9277
d824f1a3c341
The "initialize wav header with infinite lenght" broke the
arpi
parents:
9223
diff
changeset
|
153 wavhdr.data_length=le2me_32(0x7ffff000); |
d824f1a3c341
The "initialize wav header with infinite lenght" broke the
arpi
parents:
9223
diff
changeset
|
154 wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
155 |
14264 | 156 mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_FileInfo, ao_outputfilename, |
157 (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, | |
158 (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); | |
13383
c1955840883d
mp_msg transition of unmaintained audio output drivers.
ivo
parents:
12145
diff
changeset
|
159 mp_msg(MSGT_AO, MSGL_INFO, MSGTR_AO_PCM_HintInfo); |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
160 |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
161 fp = fopen(ao_outputfilename, "wb"); |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
162 if(fp) { |
9277
d824f1a3c341
The "initialize wav header with infinite lenght" broke the
arpi
parents:
9223
diff
changeset
|
163 if(ao_pcm_waveheader){ /* Reserve space for wave header */ |
6501 | 164 fwrite(&wavhdr,sizeof(wavhdr),1,fp); |
9277
d824f1a3c341
The "initialize wav header with infinite lenght" broke the
arpi
parents:
9223
diff
changeset
|
165 wavhdr.file_length=wavhdr.data_length=0; |
d824f1a3c341
The "initialize wav header with infinite lenght" broke the
arpi
parents:
9223
diff
changeset
|
166 } |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
167 return 1; |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
168 } |
13383
c1955840883d
mp_msg transition of unmaintained audio output drivers.
ivo
parents:
12145
diff
changeset
|
169 mp_msg(MSGT_AO, MSGL_ERR, MSGTR_AO_PCM_CantOpenOutputFile, |
c1955840883d
mp_msg transition of unmaintained audio output drivers.
ivo
parents:
12145
diff
changeset
|
170 ao_outputfilename); |
1107 | 171 return 0; |
172 } | |
173 | |
174 // close audio device | |
12145 | 175 static void uninit(int immed){ |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
176 |
6501 | 177 if(ao_pcm_waveheader && fseek(fp, 0, SEEK_SET) == 0){ /* Write wave header */ |
4914
de4074ab4e5f
good-looking fix by Tobias Diedrich <td@informatik.uni-hannover.de>
arpi
parents:
3095
diff
changeset
|
178 wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
179 wavhdr.file_length = le2me_32(wavhdr.file_length); |
6762 | 180 wavhdr.data_length = le2me_32(wavhdr.data_length); |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
181 fwrite(&wavhdr,sizeof(wavhdr),1,fp); |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
182 } |
1107 | 183 fclose(fp); |
14298
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
184 if (ao_outputfilename) |
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
185 free(ao_outputfilename); |
3c818342a02b
Add -ao pcm suboptions and remove -aofile and -waveheader options.
reimar
parents:
14264
diff
changeset
|
186 ao_outputfilename = NULL; |
1107 | 187 } |
188 | |
189 // stop playing and empty buffers (for seeking/pause) | |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
16243
diff
changeset
|
190 static void reset(void){ |
1107 | 191 |
192 } | |
193 | |
194 // stop playing, keep buffers (for pause) | |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
16243
diff
changeset
|
195 static void audio_pause(void) |
1107 | 196 { |
197 // for now, just call reset(); | |
198 reset(); | |
199 } | |
200 | |
201 // resume playing, after audio_pause() | |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
16243
diff
changeset
|
202 static void audio_resume(void) |
1107 | 203 { |
204 } | |
205 | |
206 // return: how many bytes can be played without blocking | |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
16243
diff
changeset
|
207 static int get_space(void){ |
1107 | 208 |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
209 if(vo_pts) |
18092
96fdfbad5b1a
-ao pcm:fast suboption for faster-than-realtime dumping
reimar
parents:
17566
diff
changeset
|
210 return ao_data.pts < vo_pts + fast * 30000 ? ao_data.outburst : 0; |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
211 return ao_data.outburst; |
1107 | 212 } |
213 | |
214 // plays 'len' bytes of 'data' | |
215 // it should round it down to outburst*n | |
216 // return: number of bytes played | |
217 static int play(void* data,int len,int flags){ | |
218 | |
7658 | 219 // let libaf to do the conversion... |
220 #if 0 | |
221 //#ifdef WORDS_BIGENDIAN | |
222 if (ao_data.format == AFMT_S16_LE) { | |
223 unsigned short *buffer = (unsigned short *) data; | |
224 register int i; | |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
225 for(i = 0; i < len/2; ++i) { |
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
226 buffer[i] = le2me_16(buffer[i]); |
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
227 } |
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
228 } |
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
229 #endif |
7658 | 230 |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
231 if (ao_data.channels == 6 || ao_data.channels == 5) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
232 int frame_size = le2me_16(wavhdr.bits) / 8; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
233 len -= len % (frame_size * ao_data.channels); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
234 reorder_channel_nch(data, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
235 AF_CHANNEL_LAYOUT_WAVEEX_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
236 ao_data.channels, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
237 len / frame_size, frame_size); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
238 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
25097
diff
changeset
|
239 |
1107 | 240 //printf("PCM: Writing chunk!\n"); |
241 fwrite(data,len,1,fp); | |
5837
7e082f42497a
- Fix for big apple architectures by Rogerio Brito, reworked by me to use bswap.h macros.
atmos4
parents:
4914
diff
changeset
|
242 |
1112
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
243 if(ao_pcm_waveheader) |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
244 wavhdr.data_length += len; |
b1cf1087ec33
Added support for writing wave files and specifying filename to write to.
atmosfear
parents:
1107
diff
changeset
|
245 |
1107 | 246 return len; |
247 } | |
248 | |
3095 | 249 // return: delay in seconds between first and last sample in buffer |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
16243
diff
changeset
|
250 static float get_delay(void){ |
1107 | 251 |
3095 | 252 return 0.0; |
1107 | 253 } |
254 | |
255 | |
256 | |
257 | |
258 | |
259 |