[vlc-commits] codec: faad: set default rate to source's (fix #14213)

Francois Cartegnie git at videolan.org
Wed Apr 8 18:18:28 CEST 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr  7 21:13:02 2015 +0200| [76be75bce92c206916e7afff29ee9d6fb9a85f54] | committer: Jean-Baptiste Kempf

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

(cherry picked from commit 06682f220832758726789cb735bfb89f80cabe56)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=76be75bce92c206916e7afff29ee9d6fb9a85f54
---

 modules/codec/faad.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index a51861e..99a9bbd 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 );
 



More information about the vlc-commits mailing list