From 7a59964ba9c2e39ccf500ae3e57e77abc9afdfa2 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 19 May 2012 18:39:12 +0200 Subject: [PATCH] swr: add swr_inject_silence() Signed-off-by: Michael Niedermayer --- libswresample/swresample.c | 24 ++++++++++++++++++++++++ libswresample/swresample.h | 7 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 4718ce8615..086c421bad 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -676,3 +676,27 @@ int swr_convert(struct SwrContext *s, uint8_t *out_arg[SWR_CH_MAX], int out_coun } } +int swr_inject_silence(struct SwrContext *s, int count){ + int ret, i; + AudioData silence = s->out; + uint8_t *tmp_arg[SWR_CH_MAX]; + + if(count <= 0) + return 0; + + silence.count = 0; + silence.data = NULL; + if((ret=realloc_audio(&silence, count))<0) + return ret; + + if(silence.planar) for(i=0; i