[vlc-commits] playlist: add playlist_GetAout()

Rémi Denis-Courmont git at videolan.org
Thu Nov 1 21:44:43 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov  1 22:24:29 2012 +0200| [0716a9163a993de26a76796a7b302865d19ad9e0] | committer: Rémi Denis-Courmont

playlist: add playlist_GetAout()

Contrary to input_GetAout(), this works even without input thread.

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

 include/vlc_playlist.h |    2 ++
 src/libvlccore.sym     |    1 +
 src/playlist/aout.c    |   14 +++++++-------
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 09f4162..ea269a2 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -368,6 +368,8 @@ VLC_API playlist_item_t * playlist_GetPrevLeaf( playlist_t *p_playlist, playlist
  * Audio output management
  **************************/
 
+VLC_API audio_output_t *playlist_GetAout( playlist_t * );
+
 #define AOUT_VOLUME_DEFAULT             256
 #define AOUT_VOLUME_MAX                 512
 
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 3851189..a3cfbd4 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -350,6 +350,7 @@ playlist_Status
 playlist_TreeMove
 playlist_TreeMoveMany
 playlist_Unlock
+playlist_GetAout
 playlist_EnableAudioFilter
 playlist_VolumeGet
 playlist_VolumeSet
diff --git a/src/playlist/aout.c b/src/playlist/aout.c
index 2203d2d..fd66e92 100644
--- a/src/playlist/aout.c
+++ b/src/playlist/aout.c
@@ -31,7 +31,7 @@
 #include "../audio_output/aout_internal.h"
 #include "playlist_internal.h"
 
-static inline audio_output_t *findAout(playlist_t *pl)
+audio_output_t *playlist_GetAout(playlist_t *pl)
 {
     /* NOTE: it is assumed that the input resource exists. In practice,
      * the playlist must have been activated. This is automatic when calling         * pl_Get(). FIXME: input resources are deleted at deactivation, this can
@@ -44,7 +44,7 @@ float playlist_VolumeGet (playlist_t *pl)
 {
     float volume = -1.f;
 
-    audio_output_t *aout = findAout (pl);
+    audio_output_t *aout = playlist_GetAout (pl);
     if (aout != NULL)
     {
         volume = aout_VolumeGet (aout);
@@ -57,7 +57,7 @@ int playlist_VolumeSet (playlist_t *pl, float vol)
 {
     int ret = -1;
 
-    audio_output_t *aout = findAout (pl);
+    audio_output_t *aout = playlist_GetAout (pl);
     if (aout != NULL)
     {
         ret = aout_VolumeSet (aout, vol);
@@ -77,7 +77,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
 
     value *= var_InheritInteger (pl, "volume-step");
 
-    audio_output_t *aout = findAout (pl);
+    audio_output_t *aout = playlist_GetAout (pl);
     if (aout != NULL)
     {
         float vol = aout_VolumeGet (aout);
@@ -101,7 +101,7 @@ int playlist_MuteGet (playlist_t *pl)
 {
     int mute = -1;
 
-    audio_output_t *aout = findAout (pl);
+    audio_output_t *aout = playlist_GetAout (pl);
     if (aout != NULL)
     {
         mute = aout_MuteGet (aout);
@@ -114,7 +114,7 @@ int playlist_MuteSet (playlist_t *pl, bool mute)
 {
     int ret = -1;
 
-    audio_output_t *aout = findAout (pl);
+    audio_output_t *aout = playlist_GetAout (pl);
     if (aout != NULL)
     {
         ret = aout_MuteSet (aout, mute);
@@ -127,7 +127,7 @@ int playlist_MuteSet (playlist_t *pl, bool mute)
 
 void playlist_EnableAudioFilter (playlist_t *pl, const char *name, bool add)
 {
-    audio_output_t *aout = findAout (pl);
+    audio_output_t *aout = playlist_GetAout (pl);
 
     if (aout_ChangeFilterString (VLC_OBJECT(pl), VLC_OBJECT(aout),
                                  "audio-filter", name, add))



More information about the vlc-commits mailing list