[vlc-commits] player: add vlc_player_aout_Reset

Thomas Guillem git at videolan.org
Fri Jul 24 09:16:22 CEST 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 22 15:36:34 2020 +0200| [d3dd117c8d73208624f09f2acf4243ab104c52b1] | committer: Thomas Guillem

player: add vlc_player_aout_Reset

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

 include/vlc_player.h | 11 +++++++++++
 src/libvlccore.sym   |  1 +
 src/player/aout.c    | 11 +++++++++++
 3 files changed, 23 insertions(+)

diff --git a/include/vlc_player.h b/include/vlc_player.h
index 763aae564d..ac5991982d 100644
--- a/include/vlc_player.h
+++ b/include/vlc_player.h
@@ -2210,6 +2210,17 @@ struct vlc_player_aout_cbs
 VLC_API audio_output_t *
 vlc_player_aout_Hold(vlc_player_t *player);
 
+/**
+ * Reset the main audio output
+ *
+ * @warning The main aout can only by reset if it is not currently used by any
+ * decoders (before any play).
+ *
+ * @param player player instance
+ */
+VLC_API void
+vlc_player_aout_Reset(vlc_player_t *player);
+
 /**
  * Add a listener callback for audio output events
  *
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 7361b29e6f..d7d93aa549 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -779,6 +779,7 @@ vlc_player_aout_AddListener
 vlc_player_aout_EnableFilter
 vlc_player_aout_GetVolume
 vlc_player_aout_Hold
+vlc_player_aout_Reset
 vlc_player_aout_IncrementVolume
 vlc_player_aout_IsMuted
 vlc_player_aout_Mute
diff --git a/src/player/aout.c b/src/player/aout.c
index 840d0e01fe..8674cc6535 100644
--- a/src/player/aout.c
+++ b/src/player/aout.c
@@ -237,3 +237,14 @@ vlc_player_aout_Deinit(vlc_player_t *player)
 {
     vlc_player_aout_DelCallbacks(player);
 }
+
+void
+vlc_player_aout_Reset(vlc_player_t *player)
+{
+    vlc_player_aout_Deinit(player);
+
+    input_resource_ResetAout(player->resource);
+
+    vlc_player_aout_Init(player);
+}
+



More information about the vlc-commits mailing list