AUD_log (AUDIO_CAP, "Reason: %s\n", pa_strerror (err));
}
+#ifndef PA_CONTEXT_IS_GOOD
+static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x)
+{
+ return
+ x == PA_CONTEXT_CONNECTING ||
+ x == PA_CONTEXT_AUTHORIZING ||
+ x == PA_CONTEXT_SETTING_NAME ||
+ x == PA_CONTEXT_READY;
+}
+#endif
+
+#ifndef PA_STREAM_IS_GOOD
+static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x)
+{
+ return
+ x == PA_STREAM_CREATING ||
+ x == PA_STREAM_READY;
+}
+#endif
+
#define CHECK_SUCCESS_GOTO(c, rerror, expression, label) \
do { \
if (!(expression)) { \
if (dir == PA_STREAM_PLAYBACK) {
r = pa_stream_connect_playback (stream, dev, attr,
PA_STREAM_INTERPOLATE_TIMING
+#ifdef PA_STREAM_ADJUST_LATENCY
|PA_STREAM_ADJUST_LATENCY
+#endif
|PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL);
} else {
r = pa_stream_connect_record (stream, dev, attr,
PA_STREAM_INTERPOLATE_TIMING
+#ifdef PA_STREAM_ADJUST_LATENCY
|PA_STREAM_ADJUST_LATENCY
+#endif
|PA_STREAM_AUTO_TIMING_UPDATE);
}
pa_stream_unref (stream);
}
- qpa_logerr (pa_context_errno (g->context),
- "stream_new() failed\n");
+ *rerror = pa_context_errno (g->context);
return NULL;
}
ss.rate = as->freq;
/*
- * qemu audio tick runs at 250 Hz (by default), so processing
- * data chunks worth 4 ms of sound should be a good fit.
+ * qemu audio tick runs at 100 Hz (by default), so processing
+ * data chunks worth 10 ms of sound should be a good fit.
*/
- ba.tlength = pa_usec_to_bytes (4 * 1000, &ss);
- ba.minreq = pa_usec_to_bytes (2 * 1000, &ss);
+ ba.tlength = pa_usec_to_bytes (10 * 1000, &ss);
+ ba.minreq = pa_usec_to_bytes (5 * 1000, &ss);
ba.maxlength = -1;
ba.prebuf = -1;
pa_cvolume v;
paaudio *g = &glob_paaudio;
- pa_cvolume_init (&v);
+#ifdef PA_CHECK_VERSION /* macro is present in 0.9.16+ */
+ pa_cvolume_init (&v); /* function is present in 0.9.13+ */
+#endif
switch (cmd) {
case VOICE_VOLUME:
pa_cvolume v;
paaudio *g = &glob_paaudio;
+#ifdef PA_CHECK_VERSION
pa_cvolume_init (&v);
+#endif
switch (cmd) {
case VOICE_VOLUME: