[FFmpeg-devel] [PATCH] avcodec/aacdec: map LFE[0] to SCE[1] for 4.0 audio.
Michael Niedermayer
michaelni at gmx.at
Sat Oct 18 05:15:29 CEST 2014
On Fri, Oct 17, 2014 at 11:47:38AM +0200, Benoit Fouet wrote:
> Hi,
>
> ----- Mail original -----
> > On Mon, Oct 13, 2014 at 02:42:55PM +0200, Benoit Fouet wrote:
> > > Fixes ticket #3930
> > > ---
> > > libavcodec/aacdec.c | 10 ++++++++++
> > > 1 file changed, 10 insertions(+)
> >
> > applied
> >
> > maybe these special case mappings should print some warning or
> > some debug information, could help if they are ever wrong
> >
>
> See attached patch.
>
> --
> Ben
> aacdec.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
> c1e762dd6f38e2125c5bde84bd8439cd92d07f56 0001-avcodec-aacdec-warn-user-when-remapping-streams.patch
> From bf370c0c2ec49881d7a2de1fd74e7bd5b2b2e12d Mon Sep 17 00:00:00 2001
> From: Benoit Fouet <benoit.fouet at free.fr>
> Date: Fri, 17 Oct 2014 11:44:55 +0200
> Subject: [PATCH] avcodec/aacdec: warn user when remapping streams.
>
> ---
> libavcodec/aacdec.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
> index ed12e7d..83cb384 100644
> --- a/libavcodec/aacdec.c
> +++ b/libavcodec/aacdec.c
> @@ -621,6 +621,10 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
> * If we seem to have encountered such a stream, transfer
> * the LFE[0] element to the SCE[1]'s mapping */
> if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
> + if (type != TYPE_LFE || elem_id != 0)
> + av_log(ac->avctx, AV_LOG_WARNING,
> + "This stream seems to incorrectly report its last channel as %s[%d], mapping to LFE[0]\n",
> + type == TYPE_SCE ? "SCE" : "LFE", elem_id);
> ac->tags_mapped++;
> return ac->tag_che_map[type][elem_id] = ac->che[TYPE_LFE][0];
> }
> @@ -637,6 +641,10 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
> * If we seem to have encountered such a stream, transfer
> * the SCE[1] element to the LFE[0]'s mapping */
> if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) {
> + if (type != TYPE_SCE || elem_id != 1)
> + av_log(ac->avctx, AV_LOG_WARNING,
> + "This stream seems to incorrectly report its last channel as %s[%d], mapping to SCE[1]\n",
> + type == TYPE_SCE ? "SCE" : "LFE", elem_id);
these would print thousands of warnings for an affected file
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is what and why we do it that matters, not just one of them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141018/4c76471a/attachment.asc>
More information about the ffmpeg-devel
mailing list