OSDN Git Service

Merge commit 'e951b6d94c441d46b396ef12da1428297d77251d'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Feb 2013 11:39:26 +0000 (12:39 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 26 Feb 2013 11:39:26 +0000 (12:39 +0100)
* commit 'e951b6d94c441d46b396ef12da1428297d77251d':
  vorbisdec: cosmetics: rename variable avccontext to avctx
  configure: Identify icc compiler with a less ambiguous pattern

Conflicts:
libavcodec/vorbisdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure
libavcodec/vorbis.c
libavcodec/vorbis.h
libavcodec/vorbisdec.c

diff --cc configure
Simple merge
Simple merge
Simple merge
@@@ -692,9 -684,9 +690,9 @@@ static int vorbis_parse_setup_hdr_resid
          res_setup->partition_size = get_bits(gb, 24) + 1;
          /* Validations to prevent a buffer overflow later. */
          if (res_setup->begin>res_setup->end ||
 -            res_setup->end > (res_setup->type == 2 ? vc->avctx->channels : 1) * vc->blocksize[1] / 2 ||
 +            res_setup->end > (res_setup->type == 2 ? vc->audio_channels : 1) * vc->blocksize[1] / 2 ||
              (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
-             av_log(vc->avccontext, AV_LOG_ERROR,
+             av_log(vc->avctx, AV_LOG_ERROR,
                     "partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
                     res_setup->type, res_setup->begin, res_setup->end,
                     res_setup->partition_size, vc->blocksize[1] / 2);
@@@ -947,12 -939,12 +945,12 @@@ static int vorbis_parse_id_hdr(vorbis_c
      vc->bitrate_minimum = get_bits_long(gb, 32);
      bl0 = get_bits(gb, 4);
      bl1 = get_bits(gb, 4);
 -    vc->blocksize[0] = (1 << bl0);
 -    vc->blocksize[1] = (1 << bl1);
      if (bl0 > 13 || bl0 < 6 || bl1 > 13 || bl1 < 6 || bl1 < bl0) {
-         av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (illegal blocksize). \n");
+         av_log(vc->avctx, AV_LOG_ERROR, " Vorbis id header packet corrupt (illegal blocksize). \n");
          return AVERROR_INVALIDDATA;
      }
 +    vc->blocksize[0] = (1 << bl0);
 +    vc->blocksize[1] = (1 << bl1);
      vc->win[0] = ff_vorbis_vwin[bl0 - 6];
      vc->win[1] = ff_vorbis_vwin[bl1 - 6];
  
@@@ -1663,49 -1654,10 +1660,49 @@@ static int vorbis_decode_frame(AVCodecC
  
      av_dlog(NULL, "packet length %d \n", buf_size);
  
-             av_log(avccontext, AV_LOG_ERROR, "Id header corrupt.\n");
 +    if (*buf == 1 && buf_size > 7) {
 +        init_get_bits(gb, buf+1, buf_size*8 - 8);
 +        vorbis_free(vc);
 +        if ((ret = vorbis_parse_id_hdr(vc))) {
-             avccontext->channel_layout = 0;
++            av_log(avctx, AV_LOG_ERROR, "Id header corrupt.\n");
 +            vorbis_free(vc);
 +            return ret;
 +        }
 +
 +        if (vc->audio_channels > 8)
-             avccontext->channel_layout = ff_vorbis_channel_layouts[vc->audio_channels - 1];
++            avctx->channel_layout = 0;
 +        else
-         avccontext->channels    = vc->audio_channels;
-         avccontext->sample_rate = vc->audio_samplerate;
++            avctx->channel_layout = ff_vorbis_channel_layouts[vc->audio_channels - 1];
 +
-         av_log(avccontext, AV_LOG_DEBUG, "Ignoring comment header\n");
++        avctx->channels    = vc->audio_channels;
++        avctx->sample_rate = vc->audio_samplerate;
 +        return buf_size;
 +    }
 +
 +    if (*buf == 3 && buf_size > 7) {
-             av_log(avccontext, AV_LOG_ERROR, "Setup header corrupt.\n");
++        av_log(avctx, AV_LOG_DEBUG, "Ignoring comment header\n");
 +        return buf_size;
 +    }
 +
 +    if (*buf == 5 && buf_size > 7 && vc->channel_residues && !vc->modes) {
 +        init_get_bits(gb, buf+1, buf_size*8 - 8);
 +        if ((ret = vorbis_parse_setup_hdr(vc))) {
-         av_log(avccontext, AV_LOG_ERROR, "Data packet before valid headers\n");
++            av_log(avctx, AV_LOG_ERROR, "Setup header corrupt.\n");
 +            vorbis_free(vc);
 +            return ret;
 +        }
 +        return buf_size;
 +    }
 +
 +    if (!vc->channel_residues || !vc->modes) {
++        av_log(avctx, AV_LOG_ERROR, "Data packet before valid headers\n");
 +        return AVERROR_INVALIDDATA;
 +    }
 +
      /* get output buffer */
      frame->nb_samples = vc->blocksize[1] / 2;
-     if ((ret = ff_get_buffer(avccontext, frame)) < 0) {
-         av_log(avccontext, AV_LOG_ERROR, "get_buffer() failed\n");
+     if ((ret = ff_get_buffer(avctx, frame)) < 0) {
+         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
          return ret;
      }