Commit 9dc41985 authored by Thomas Guillem's avatar 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.
parent 51ca6396
......@@ -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
{
......@@ -178,6 +182,26 @@ static inline void filter_FlushPictures( filter_t *p_filter )
p_filter->pf_video_flush( 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment