Merge commit 'a10c4ce24bd4a0dd557d5849aa53a0cc74677808'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 5 Aug 2013 07:52:06 +0000 (09:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 5 Aug 2013 07:52:06 +0000 (09:52 +0200)
* commit 'a10c4ce24bd4a0dd557d5849aa53a0cc74677808':
  aac: Forward errors properly in aac_decode_frame_int

Conflicts:
libavcodec/aacdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/aacdec.c

index e54d4cd584c3c828b90a6cc581be19a57a3bf170,62246b6327ef4d65931b155788ac727fbe375ea5..12e09f02c24896bb01da329607de9bb78c342e84
@@@ -2520,29 -2439,17 +2520,32 @@@ static int parse_adts_frame_header(AACC
          push_output_configuration(ac);
          if (hdr_info.chan_config) {
              ac->oc[1].m4ac.chan_config = hdr_info.chan_config;
-             if (set_default_channel_config(ac->avctx, layout_map,
-                     &layout_map_tags, hdr_info.chan_config))
-                 return -7;
-             if (output_configure(ac, layout_map, layout_map_tags,
-                                  FFMAX(ac->oc[1].status, OC_TRIAL_FRAME), 0))
-                 return -7;
+             if ((ret = set_default_channel_config(ac->avctx,
+                                                   layout_map,
+                                                   &layout_map_tags,
+                                                   hdr_info.chan_config)) < 0)
+                 return ret;
+             if ((ret = output_configure(ac, layout_map, layout_map_tags,
+                                         FFMAX(ac->oc[1].status,
+                                               OC_TRIAL_FRAME), 0)) < 0)
+                 return ret;
          } else {
              ac->oc[1].m4ac.chan_config = 0;
 +            /**
 +             * dual mono frames in Japanese DTV can have chan_config 0
 +             * WITHOUT specifying PCE.
 +             *  thus, set dual mono as default.
 +             */
 +            if (ac->dmono_mode && ac->oc[0].status == OC_NONE) {
 +                layout_map_tags = 2;
 +                layout_map[0][0] = layout_map[1][0] = TYPE_SCE;
 +                layout_map[0][2] = layout_map[1][2] = AAC_CHANNEL_FRONT;
 +                layout_map[0][1] = 0;
 +                layout_map[1][1] = 1;
 +                if (output_configure(ac, layout_map, layout_map_tags,
 +                                     OC_TRIAL_FRAME, 0))
 +                    return -7;
 +            }
          }
          ac->oc[1].m4ac.sample_rate     = hdr_info.sample_rate;
          ac->oc[1].m4ac.sampling_index  = hdr_info.sampling_index;
@@@ -2655,8 -2556,8 +2655,8 @@@ static int aac_decode_frame_int(AVCodec
              if (elem_id == 15)
                  elem_id += get_bits(gb, 8) - 1;
              if (get_bits_left(gb) < 8 * elem_id) {
 -                    av_log(avctx, AV_LOG_ERROR, overread_err);
 +                    av_log(avctx, AV_LOG_ERROR, "TYPE_FIL: "overread_err);
-                     err = -1;
+                     err = AVERROR_INVALIDDATA;
                      goto fail;
              }
              while (elem_id > 0)