diff options
author | wm4 <wm4@nowhere> | 2015-10-05 18:53:02 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-05 19:12:23 +0200 |
commit | 54fbda2ba40de1d94d49cef2c46160eb7ffa195a (patch) | |
tree | 0749d3a757f8abee199222bf08f802b2a7c2a4f1 /audio | |
parent | e694d6736699d385772a3942aad52bba4bb7caf9 (diff) |
audio: add option for falling back to ao_null
The manpage entry explains this.
(Maybe this option could be always enabled and removed. I don't quite
remember what valid use-cases there are for just disabling audio
entirely, other than that this is also needed for audio decoder init
failure.)
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao.c | 6 | ||||
-rw-r--r-- | audio/out/ao.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c index 23c3987cb3..6330ec9d48 100644 --- a/audio/out/ao.c +++ b/audio/out/ao.c @@ -240,6 +240,7 @@ static void split_ao_device(void *tmp, char *opt, char **out_ao, char **out_dev) } struct ao *ao_init_best(struct mpv_global *global, + bool ao_null_fallback, struct input_ctx *input_ctx, struct encode_lavc_context *encode_lavc_ctx, int samplerate, int format, struct mp_chmap channels) @@ -282,6 +283,11 @@ struct ao *ao_init_best(struct mpv_global *global, } } + if (ao_null_fallback) { + MP_TARRAY_APPEND(tmp, ao_list, ao_num, + (struct m_obj_settings){.name = "null"}); + } + for (int n = 0; n < ao_num; n++) { struct m_obj_settings *entry = &ao_list[n]; bool probing = n + 1 != ao_num; diff --git a/audio/out/ao.h b/audio/out/ao.h index baf10ace19..e8e64e33eb 100644 --- a/audio/out/ao.h +++ b/audio/out/ao.h @@ -72,6 +72,7 @@ struct encode_lavc_context; struct mp_audio; struct ao *ao_init_best(struct mpv_global *global, + bool ao_null_fallback, struct input_ctx *input_ctx, struct encode_lavc_context *encode_lavc_ctx, int samplerate, int format, struct mp_chmap channels); |