|
41 | 41 | #include <ao/ao.h>
|
42 | 42 | #include <ao/plugin.h>
|
43 | 43 |
|
44 |
| -#define AO_PULSE_BUFFER_TIME 20000 |
| 44 | +#define AO_PULSE_BUFFER_TIME 20 |
45 | 45 |
|
46 | 46 | /* Unfortunately libao doesn't allow "const" for these structures... */
|
47 | 47 | static char * ao_pulse_options[] = {
|
@@ -73,7 +73,7 @@ typedef struct ao_pulse_internal {
|
73 | 73 | struct pa_simple *simple;
|
74 | 74 | char *server, *sink, *client_name;
|
75 | 75 | pa_usec_t static_delay;
|
76 |
| - pa_usec_t buffer_time; |
| 76 | + int buffer_time; |
77 | 77 | } ao_pulse_internal;
|
78 | 78 |
|
79 | 79 | /* Yes, this is very ugly, but required nonetheless... */
|
@@ -174,8 +174,8 @@ int ao_plugin_set_option(ao_device *device, const char *key, const char *value)
|
174 | 174 | } else if (!strcmp(key, "client_name")) {
|
175 | 175 | free(internal->client_name);
|
176 | 176 | internal->client_name = strdup(value);
|
177 |
| - }else if (!strcmp(key, "buffer_time")){ |
178 |
| - internal->buffer_time = atoi(value) * 1000; |
| 177 | + } else if (!strcmp(key, "buffer_time")) { |
| 178 | + internal->buffer_time = atoi(value); |
179 | 179 | }
|
180 | 180 |
|
181 | 181 | return 1;
|
@@ -258,7 +258,7 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format) {
|
258 | 258 | /* buffering attributes */
|
259 | 259 | battr.prebuf = battr.minreq = battr.fragsize = battr.maxlength = -1;
|
260 | 260 |
|
261 |
| - battr.tlength = internal->buffer_time * format->rate / 1000000 * |
| 261 | + battr.tlength = internal->buffer_time * format->rate / 1000 * |
262 | 262 | (format->bits / 8) * device->output_channels;
|
263 | 263 |
|
264 | 264 | internal->simple = pa_simple_new(internal->server, t, PA_STREAM_PLAYBACK,
|
|
0 commit comments