summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/out/ao.c')
-rw-r--r--audio/out/ao.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index 02415b0f2d..b77d401d64 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -25,7 +25,9 @@
#include "config.h"
#include "ao.h"
+#include "internal.h"
#include "audio/format.h"
+#include "audio/audio.h"
#include "options/options.h"
#include "options/m_config.h"
@@ -231,8 +233,15 @@ int ao_play(struct ao *ao, void **data, int samples, int flags)
int ao_control(struct ao *ao, enum aocontrol cmd, void *arg)
{
- if (ao->driver->control)
- return ao->driver->control(ao, cmd, arg);
+ switch (cmd) {
+ case AOCONTROL_HAS_TEMP_VOLUME:
+ return !ao->no_persistent_volume;
+ case AOCONTROL_HAS_PER_APP_VOLUME:
+ return !!ao->per_application_mixer;
+ default:
+ if (ao->driver->control)
+ return ao->driver->control(ao, cmd, arg);
+ }
return CONTROL_UNKNOWN;
}
@@ -307,3 +316,28 @@ bool ao_chmap_sel_get_def(struct ao *ao, const struct mp_chmap_sel *s,
{
return mp_chmap_sel_get_def(s, map, num);
}
+
+// --- The following functions just return immutable information.
+
+void ao_get_format(struct ao *ao, struct mp_audio *format)
+{
+ *format = (struct mp_audio){0};
+ mp_audio_set_format(format, ao->format);
+ mp_audio_set_channels(format, &ao->channels);
+ format->rate = ao->samplerate;
+}
+
+const char *ao_get_name(struct ao *ao)
+{
+ return ao->driver->name;
+}
+
+const char *ao_get_description(struct ao *ao)
+{
+ return ao->driver->description;
+}
+
+bool ao_untimed(struct ao *ao)
+{
+ return ao->untimed;
+}