upstream: audio sub-system improvements.
This patch updates the audio subsystem to match the one
in upstream. Note that this gets rid of the ability to
specify different audio backends for input and output,
which was never really used.
A future patch will remove the -audio-in and -audio-out
options and related code.
Change-Id: I37c21672bcb15ef1f0e928c56bf99fbecda2bce6
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 9f75f19..d3764c8 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -245,8 +245,8 @@
{
HW *hw;
AudioState *s = &glob_audio_state;
- struct audio_driver *drv = glue(s->drv_, TYPE);
- int err;
+ struct audio_driver *drv = s->drv;
+ int err;
if (!glue (s->nb_hw_voices_, TYPE)) {
return NULL;
@@ -433,7 +433,7 @@
goto fail;
}
- if (audio_bug (AUDIO_FUNC, !glue (s->drv_, TYPE))) {
+ if (audio_bug (AUDIO_FUNC, !s->drv)) {
dolog ("Can not open `%s' (no host audio driver)\n", name);
goto fail;
}
@@ -452,9 +452,9 @@
SW_NAME (sw), sw->info.freq, sw->info.bits, sw->info.nchannels);
dolog ("New %s freq %d, bits %d, channels %d\n",
name,
- freq,
- (fmt == AUD_FMT_S16 || fmt == AUD_FMT_U16) ? 16 : 8,
- nchannels);
+ as->freq,
+ (as->fmt == AUD_FMT_S16 || as->fmt == AUD_FMT_U16) ? 16 : 8,
+ as->nchannels);
#endif
if (live) {
@@ -548,7 +548,7 @@
cur_ts = sw->hw->ts_helper;
old_ts = ts->old_ts;
- /* dolog ("cur %lld old %lld\n", cur_ts, old_ts); */
+ /* dolog ("cur %" PRId64 " old %" PRId64 "\n", cur_ts, old_ts); */
if (cur_ts >= old_ts) {
delta = cur_ts - old_ts;