[vlc-commits] Revert "input: remove unused input_resource_ResetAout() function"
Thomas Guillem
git at videolan.org
Fri Jul 24 09:16:19 CEST 2020
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 22 15:19:07 2020 +0200| [a64695dd92954bd7ff1d62852b28d5d54bb3d002] | committer: Thomas Guillem
Revert "input: remove unused input_resource_ResetAout() function"
This reverts commit 72d3ebd544a49340127577b253a3a4914be604cb.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a64695dd92954bd7ff1d62852b28d5d54bb3d002
---
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 94cceda61a..997d20fd61 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 92361363e1..be870f78a2 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 7361b29e6f..c160389026 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
More information about the vlc-commits
mailing list