diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2016-02-17 14:41:07 +0100 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2016-02-17 14:41:07 +0100 |
commit | 3da6e9fad4c6788098cf425369fb3d7860cb824f (patch) | |
tree | 95751052d331a35162c242a4c2d2f177a9b7ada0 /plugins/audio | |
parent | 6d0846d769256e74a3f403fc0e5965e2d227b324 (diff) | |
parent | fcfb3c0951b6e2e06e7bf282e867576d8abb00c4 (diff) |
Merge origin/master
Diffstat (limited to 'plugins/audio')
-rw-r--r-- | plugins/audio/audio-alsa.c | 2 | ||||
-rw-r--r-- | plugins/audio/audio-api.c | 14 | ||||
-rw-r--r-- | plugins/audio/audio-pulse.c | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/plugins/audio/audio-alsa.c b/plugins/audio/audio-alsa.c index 7310ea89..bc777fce 100644 --- a/plugins/audio/audio-alsa.c +++ b/plugins/audio/audio-alsa.c @@ -130,6 +130,8 @@ PUBLIC unsigned char _alsa_init (const char *name, audioCtxHandleT *ctx) { ctx->mute = _alsa_get_mute (num); ctx->idx = num; + if (verbose) fprintf (stderr, "Successfully initialized ALSA backend.\n"); + return 0; } diff --git a/plugins/audio/audio-api.c b/plugins/audio/audio-api.c index 4a8d0da1..637f9d03 100644 --- a/plugins/audio/audio-api.c +++ b/plugins/audio/audio-api.c @@ -22,10 +22,18 @@ void _backend_init (const char *name, audioCtxHandleT *ctx) { + char *backend_env = getenv ("AFB_AUDIO_OUTPUT"); + unsigned char res = -1; + # ifdef HAVE_PULSE - if (_pulse_init (name, ctx) < 0) -# endif - _alsa_init (name, ctx); + if (!backend_env || (strcasecmp (backend_env, "Alsa") != 0)) + res = _pulse_init (name, ctx); + if (res < 0) +#endif + res = _alsa_init (name, ctx); + + if (res < 0 && verbose) + fprintf (stderr, "Could not initialize Audio backend\n"); } void _backend_free (audioCtxHandleT *ctx) { diff --git a/plugins/audio/audio-pulse.c b/plugins/audio/audio-pulse.c index 4caf3db5..ceffcf7d 100644 --- a/plugins/audio/audio-pulse.c +++ b/plugins/audio/audio-pulse.c @@ -94,6 +94,8 @@ PUBLIC unsigned char _pulse_init (const char *name, audioCtxHandleT *ctx) { client_count++; + if (verbose) fprintf (stderr, "Successfully initialized PulseAudio backend.\n"); + return 0; } |