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
From bf370c0c2ec49881d7a2de1fd74e7bd5b2b2e12d Mon Sep 17 00:00:00 2001
From: Benoit Fouet <benoit.fo...@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);
             ac->tags_mapped++;
             return ac->tag_che_map[type][elem_id] = ac->che[TYPE_SCE][1];
         }
-- 
2.1.2.443.g670a3c1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to