[vlc-commits] aout: prepare to add private data to the volume mixer object

Rémi Denis-Courmont git at videolan.org
Tue Jul 17 21:50:05 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jul 17 18:55:51 2012 +0300| [fe08f7fbf9356c5ab0da41733b3df30d97b43b64] | committer: Rémi Denis-Courmont

aout: prepare to add private data to the volume mixer object

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe08f7fbf9356c5ab0da41733b3df30d97b43b64
---

 src/audio_output/mixer.c |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/audio_output/mixer.c b/src/audio_output/mixer.c
index 81b9480..28b3faf 100644
--- a/src/audio_output/mixer.c
+++ b/src/audio_output/mixer.c
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * mixer.c : audio output mixing operations
+ * mixer.c : audio output volume operations
  *****************************************************************************
  * Copyright (C) 2002-2004 VLC authors and VideoLAN
  * $Id$
@@ -38,13 +38,29 @@
 #include <vlc_aout_mixer.h>
 #include "aout_internal.h"
 
+/* Note: Once upon a time, the audio output volume module was also responsible
+ * for mixing multiple audio inputs together. Hence it was called mixer.
+ * Nowadays, there is only ever a single input per module instance, so this has
+ * become a misnomer. */
+
+typedef struct aout_volume
+{
+    audio_mixer_t volume;
+} aout_volume_t;
+
+static inline aout_volume_t *vol_priv(audio_mixer_t *volume)
+{
+    return (aout_volume_t *)volume;
+}
+
 #undef aout_MixerNew
 /**
  * Creates a software amplifier.
  */
 audio_mixer_t *aout_MixerNew(vlc_object_t *obj, vlc_fourcc_t format)
 {
-    audio_mixer_t *mixer = vlc_custom_create(obj, sizeof (*mixer), "mixer");
+    audio_mixer_t *mixer = vlc_custom_create(obj, sizeof (aout_volume_t),
+                                             "volume");
     if (unlikely(mixer == NULL))
         return NULL;
 



More information about the vlc-commits mailing list