[vlc-devel] [PATCH] lib: allow media player volume to be set before playing media
Mark Lee
mark.lee at capricasoftware.co.uk
Mon Feb 24 21:38:06 CET 2014
This is based on similar initialisation as is already done in the
playlist_Create() function.
---
include/vlc_input.h | 10 ++++++++++
lib/media_player.c | 4 ++++
src/libvlccore.sym | 2 ++
3 files changed, 16 insertions(+)
diff --git a/include/vlc_input.h b/include/vlc_input.h
index 4098e6b..176bf51 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -653,4 +653,14 @@ VLC_API void input_resource_Terminate( input_resource_t * );
*/
VLC_API audio_output_t *input_resource_HoldAout( input_resource_t * );
+/**
+ * This function creates or recycles an audio output.
+ */
+VLC_API audio_output_t *input_resource_GetAout( input_resource_t * );
+
+/**
+ * This function retains or destroys an audio output.
+ */
+VLC_API void input_resource_PutAout( input_resource_t *, audio_output_t * );
+
#endif
diff --git a/lib/media_player.c b/lib/media_player.c
index daa9def..868aefe 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -501,6 +501,10 @@ libvlc_media_player_new( libvlc_instance_t *instance )
vlc_object_release(mp);
return NULL;
}
+ audio_output_t *aout = input_resource_GetAout(mp->input.p_resource);
+ if( aout != NULL )
+ input_resource_PutAout(mp->input.p_resource, aout);
+
vlc_mutex_init (&mp->input.lock);
mp->i_refcount = 1;
mp->p_event_manager = libvlc_event_manager_new(mp, instance);
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index f6f8300..3858e43 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -217,7 +217,9 @@ input_resource_New
input_resource_Release
input_resource_TerminateVout
input_resource_Terminate
+input_resource_GetAout
input_resource_HoldAout
+input_resource_PutAout
input_Start
input_Stop
input_vaControl
--
1.8.1.2
More information about the vlc-devel
mailing list