[vlc-devel] [PATCH 1/5] Revert "input: remove unused input_resource_ResetAout() function"

Thomas Guillem thomas at gllm.fr
Wed Jul 22 15:51:07 CEST 2020


This reverts commit 72d3ebd544a49340127577b253a3a4914be604cb.
---
 include/vlc_decoder.h |  5 +++++
 src/input/resource.c  | 16 ++++++++++++++++
 src/libvlccore.sym    |  1 +
 3 files changed, 22 insertions(+)

diff --git a/include/vlc_decoder.h b/include/vlc_decoder.h
index 94cceda61a2..997d20fd615 100644
--- a/include/vlc_decoder.h
+++ b/include/vlc_decoder.h
@@ -76,5 +76,10 @@ VLC_API audio_output_t *input_resource_GetAout( input_resource_t * );
  */
 VLC_API void input_resource_PutAout( input_resource_t *, audio_output_t * );
 
+/**
+ * Prevents the existing audio output (if any) from being recycled.
+ */
+VLC_API void input_resource_ResetAout( input_resource_t * );
+
 /** @} */
 #endif
diff --git a/src/input/resource.c b/src/input/resource.c
index 92361363e15..be870f78a2d 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -320,6 +320,22 @@ audio_output_t *input_resource_HoldAout( input_resource_t *p_resource )
     return p_aout;
 }
 
+void input_resource_ResetAout( input_resource_t *p_resource )
+{
+    audio_output_t *p_aout = NULL;
+
+    vlc_mutex_lock( &p_resource->lock_hold );
+    if( !p_resource->b_aout_busy )
+        p_aout = p_resource->p_aout;
+
+    p_resource->p_aout = NULL;
+    p_resource->b_aout_busy = false;
+    vlc_mutex_unlock( &p_resource->lock_hold );
+
+    if( p_aout != NULL )
+        aout_Destroy( p_aout );
+}
+
 /* Common */
 input_resource_t *input_resource_New( vlc_object_t *p_parent )
 {
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 7361b29e6f5..c160389026b 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -214,6 +214,7 @@ input_resource_Release
 input_resource_GetAout
 input_resource_HoldAout
 input_resource_PutAout
+input_resource_ResetAout
 vlc_readdir_helper_init
 vlc_readdir_helper_finish
 vlc_readdir_helper_additem
-- 
2.27.0



More information about the vlc-devel mailing list