Commit 76be75bc authored by Francois Cartegnie's avatar Francois Cartegnie Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent fcc1f1de
...@@ -183,6 +183,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -183,6 +183,8 @@ static int Open( vlc_object_t *p_this )
/* Set the faad config */ /* Set the faad config */
cfg = faacDecGetCurrentConfiguration( p_sys->hfaad ); 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; cfg->outputFormat = HAVE_FPU ? FAAD_FMT_FLOAT : FAAD_FMT_16BIT;
faacDecSetConfiguration( p_sys->hfaad, cfg ); faacDecSetConfiguration( p_sys->hfaad, cfg );
......
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