[vlc-devel] [PATCH] lib: Fire event when an audio output is created.

Mark Lee mark.lee at capricasoftware.co.uk
Wed Jan 8 22:29:47 CET 2014


---
 include/vlc/libvlc_events.h | 1 +
 lib/event.c                 | 1 +
 lib/media_player.c          | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h
index ae1a94b..2d9e60e 100644
--- a/include/vlc/libvlc_events.h
+++ b/include/vlc/libvlc_events.h
@@ -73,6 +73,7 @@ enum libvlc_event_e {
     libvlc_MediaPlayerSnapshotTaken,
     libvlc_MediaPlayerLengthChanged,
     libvlc_MediaPlayerVout,
+    libvlc_MediaPlayerAout,
 
     libvlc_MediaListItemAdded=0x200,
     libvlc_MediaListWillAddItem,
diff --git a/lib/event.c b/lib/event.c
index 87f7d12..61e4783 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -280,6 +280,7 @@ static const event_name_t event_list[] = {
     DEF(MediaPlayerSnapshotTaken)
     DEF(MediaPlayerLengthChanged)
     DEF(MediaPlayerVout)
+    DEF(MediaPlayerAout)
 
     DEF(MediaListItemAdded)
     DEF(MediaListWillAddItem)
diff --git a/lib/media_player.c b/lib/media_player.c
index c23dd42..a6ce6b9 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -319,6 +319,11 @@ input_event_changed( vlc_object_t * p_this, char const * psz_cmd,
         event.u.media_player_vout.new_count = i_vout;
         libvlc_event_send( p_mi->p_event_manager, &event );
     }
+    else if ( newval.i_int == INPUT_EVENT_AOUT )
+    {
+        event.type = libvlc_MediaPlayerAout;
+        libvlc_event_send( p_mi->p_event_manager, &event );
+    }
 
     return VLC_SUCCESS;
 }
@@ -507,6 +512,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
     register_event(mp, PausableChanged);
 
     register_event(mp, Vout);
+    register_event(mp, Aout);
 
     /* Snapshot initialization */
     register_event(mp, SnapshotTaken);
-- 
1.8.1.2




More information about the vlc-devel mailing list