[vlc-commits] filter: add pf_audio_flush and pf_audio_drain

Thomas Guillem git at videolan.org
Tue Nov 3 16:26:44 CET 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Nov  3 15:25:55 2015 +0100| [9dc41985c90a30298db56c7bbcd27144dc02f62f] | committer: Thomas Guillem

filter: add pf_audio_flush and pf_audio_drain

pf_audio_flush will flush/reset the state of an audio filter.
pf_audio_drain will drain an audio filter, it'll returns a block_t containing
the drained output.

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

 include/vlc_filter.h |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index f2edd80..e5fc84f 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -107,8 +107,12 @@ struct filter_t
         struct
         {
             block_t *   (*pf_filter) ( filter_t *, block_t * );
+            void        (*pf_flush) ( filter_t * );
+            block_t *   (*pf_drain) ( filter_t * );
         } audio;
 #define pf_audio_filter     u.audio.pf_filter
+#define pf_audio_flush      u.audio.pf_flush
+#define pf_audio_drain      u.audio.pf_drain
 
         struct
         {
@@ -179,6 +183,26 @@ static inline void filter_FlushPictures( filter_t *p_filter )
 }
 
 /**
+ * This function will flush the state of an audio filter.
+ */
+static inline void filter_FlushAudio( filter_t *p_filter )
+{
+    if( p_filter->pf_audio_flush )
+        p_filter->pf_audio_flush( p_filter );
+}
+
+/**
+ * This function will drain, then flush an audio filter.
+ */
+static inline block_t *filter_DrainAudio( filter_t *p_filter )
+{
+    if( p_filter->pf_audio_drain )
+        return p_filter->pf_audio_drain( p_filter );
+    else
+        return NULL;
+}
+
+/**
  * This function will return a new subpicture usable by p_filter as an output
  * buffer. You have to release it using subpicture_Delete or by returning it to
  * the caller as a pf_sub_source return value.



More information about the vlc-commits mailing list