If SBR reset fails, something very bad(tm) has happened and we should wait for the next header.
From 2ba90d5358c767d22786211141ced71825a2783f Mon Sep 17 00:00:00 2001 From: Alex Converse <alex.conve...@gmail.com> Date: Fri, 20 Nov 2009 17:04:22 -0500 Subject: [PATCH 3/6] If SBR's reset procedure fails switch back to pure upsampling mode. MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1"
This is a multi-part message in MIME format. --------------1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit --- aacsbr.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) --------------1 Content-Type: text/x-patch; name="0003-If-SBR-s-reset-procedure-fails-switch-back-to-pure-u.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0003-If-SBR-s-reset-procedure-fails-switch-back-to-pure-u.patch" diff --git a/aacsbr.c b/aacsbr.c index c652fd5..c50aeb1 100644 --- a/aacsbr.c +++ b/aacsbr.c @@ -778,9 +778,15 @@ static unsigned int sbr_data(AACContext *ac, SpectralBandReplication *sbr, static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr) { - sbr_make_f_master(ac, sbr, sbr->spectrum_params); - sbr_make_f_derived(ac, sbr); + int err; + err = sbr_make_f_master(ac, sbr, sbr->spectrum_params); + if (err >= 0) + err = sbr_make_f_derived(ac, sbr); sbr->reset = 0; + if (err < 0) { + av_log(ac->avccontext, AV_LOG_ERROR, "SBR reset failed. Switching SBR to pure upsampling mode.\n"); + sbr->start = 0; + } } /** --------------1--
_______________________________________________ FFmpeg-soc mailing list FFmpeg-soc@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc