summaryrefslogtreecommitdiffstats
path: root/libao2/audio_out_internal.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-05-04 14:55:15 +0300
committerUoti Urpala <uau@mplayer2.org>2011-05-05 01:39:53 +0300
commit3a5fd15fa2568d0b5fd61c3e6b2c0b05933d8dbe (patch)
tree5d4b0bf1ff5b815515006d6b570b14c3e0a71a4a /libao2/audio_out_internal.h
parentdf7825eb312254e3cc83d718b6946361cc29aab7 (diff)
downloadmpv-3a5fd15fa2568d0b5fd61c3e6b2c0b05933d8dbe.tar.bz2
mpv-3a5fd15fa2568d0b5fd61c3e6b2c0b05933d8dbe.tar.xz
audio output: add a new AO driver API
Add a new audio output driver API. The main change is the addition of a context struct where data can be kept instead of using globals. The old API remains available. This commit does not yet convert any driver to use the new API.
Diffstat (limited to 'libao2/audio_out_internal.h')
-rw-r--r--libao2/audio_out_internal.h37
1 files changed, 24 insertions, 13 deletions
diff --git a/libao2/audio_out_internal.h b/libao2/audio_out_internal.h
index c093be6989..67bcfa953d 100644
--- a/libao2/audio_out_internal.h
+++ b/libao2/audio_out_internal.h
@@ -31,20 +31,31 @@ static float get_delay(void);
static void audio_pause(void);
static void audio_resume(void);
-extern struct ao ao_data;
+extern struct ao *global_ao;
+#define ao_data (*global_ao)
-#define LIBAO_EXTERN(x) const ao_functions_t audio_out_##x =\
-{\
- &info,\
- control,\
- init,\
- uninit,\
- reset,\
- get_space,\
- play,\
- get_delay,\
- audio_pause,\
- audio_resume\
+#define LIBAO_EXTERN(x) const struct ao_driver audio_out_##x = { \
+ .info = &info, \
+ .control = old_ao_control, \
+ .init = old_ao_init, \
+ .uninit = old_ao_uninit, \
+ .reset = old_ao_reset, \
+ .get_space = old_ao_get_space, \
+ .play = old_ao_play, \
+ .get_delay = old_ao_get_delay, \
+ .pause = old_ao_pause, \
+ .resume = old_ao_resume, \
+ .old_functions = &(const struct ao_old_functions) { \
+ .control = control, \
+ .init = init, \
+ .uninit = uninit, \
+ .reset = reset, \
+ .get_space = get_space, \
+ .play = play, \
+ .get_delay = get_delay, \
+ .pause = audio_pause, \
+ .resume = audio_resume, \
+ }, \
};
#endif /* MPLAYER_AUDIO_OUT_INTERNAL_H */