From 06682f220832758726789cb735bfb89f80cabe56 Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Tue, 7 Apr 2015 21:13:02 +0200 Subject: [PATCH] codec: faad: set default rate to source's (fix #14213) output pts/length is computed from input block pts. If sample rate is wrong, all timings are borked. Try to use the declared sample rate if possible. If source has wrong sample rate --- modules/codec/faad.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/codec/faad.c b/modules/codec/faad.c index a51861ecd5..99a9bbd8b6 100644 --- a/modules/codec/faad.c +++ b/modules/codec/faad.c @@ -183,6 +183,8 @@ static int Open( vlc_object_t *p_this ) /* Set the faad config */ cfg = faacDecGetCurrentConfiguration( p_sys->hfaad ); + if( p_dec->fmt_in.audio.i_rate ) + cfg->defSampleRate = p_dec->fmt_in.audio.i_rate; cfg->outputFormat = HAVE_FPU ? FAAD_FMT_FLOAT : FAAD_FMT_16BIT; faacDecSetConfiguration( p_sys->hfaad, cfg ); -- GitLab