diff --git a/audio/audio_template.h b/audio/audio_template.h index 235d1acbbe..1006d6b1eb 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -425,8 +425,8 @@ SW *glue (AUD_open_, TYPE) ( struct audsettings *as ) { - AudioState *s = card->state; - AudiodevPerDirectionOptions *pdo = glue(audio_get_pdo_, TYPE)(s->dev); + AudioState *s; + AudiodevPerDirectionOptions *pdo; if (audio_bug(__func__, !card || !name || !callback_fn || !as)) { dolog ("card=%p name=%p callback_fn=%p as=%p\n", @@ -434,6 +434,9 @@ SW *glue (AUD_open_, TYPE) ( goto fail; } + s = card->state; + pdo = glue(audio_get_pdo_, TYPE)(s->dev); + ldebug ("open %s, freq %d, nchannels %d, fmt %d\n", name, as->freq, as->nchannels, as->fmt);