Merge commit '67deba8a416d818f3d95aef0aa916589090396e2'
authorClément Bœsch <cboesch@gopro.com>
Fri, 31 Mar 2017 08:40:34 +0000 (10:40 +0200)
committerClément Bœsch <cboesch@gopro.com>
Fri, 31 Mar 2017 08:40:34 +0000 (10:40 +0200)
* commit '67deba8a416d818f3d95aef0aa916589090396e2':
  Use avpriv_report_missing_feature() where appropriate

Merged-by: Clément Bœsch <cboesch@gopro.com>
27 files changed:
1  2 
libavcodec/alac.c
libavcodec/bmp.c
libavcodec/fraps.c
libavcodec/g2meet.c
libavcodec/g723_1enc.c
libavcodec/h264_ps.c
libavcodec/hevc_ps_enc.c
libavcodec/libopenjpegdec.c
libavcodec/mjpegdec.c
libavcodec/opus_silk.c
libavcodec/shorten.c
libavcodec/takdec.c
libavcodec/txd.c
libavcodec/vp5.c
libavdevice/vfwcap.c
libavdevice/xcbgrab.c
libavformat/avienc.c
libavformat/lxfdec.c
libavformat/matroskadec.c
libavformat/mpc8.c
libavformat/rsoenc.c
libavformat/rtpdec_jpeg.c
libavformat/rtpdec_latm.c
libavformat/rtpdec_xiph.c
libavformat/rtsp.c
libavformat/spdifenc.c
libavformat/wvdec.c

@@@ -250,8 -265,8 +250,8 @@@ static int decode_element(AVCodecContex
  
      alac->extra_bits = get_bits(&alac->gb, 2) << 3;
      bps = alac->sample_size - alac->extra_bits + channels - 1;
 -    if (bps > 32) {
 +    if (bps > 32U) {
-         av_log(avctx, AV_LOG_ERROR, "bps is unsupported: %d\n", bps);
+         avpriv_report_missing_feature(avctx, "bps %d", bps);
          return AVERROR_PATCHWELCOME;
      }
  
@@@ -582,9 -567,9 +582,9 @@@ static av_cold int alac_decode_init(AVC
          else
              avctx->channels = alac->channels;
      }
 -    if (avctx->channels > ALAC_MAX_CHANNELS) {
 +    if (avctx->channels > ALAC_MAX_CHANNELS || avctx->channels <= 0 ) {
-         av_log(avctx, AV_LOG_ERROR, "Unsupported channel count: %d\n",
-                avctx->channels);
+         avpriv_report_missing_feature(avctx, "Channel count %d",
+                                       avctx->channels);
          return AVERROR_PATCHWELCOME;
      }
      avctx->channel_layout = ff_alac_channel_layouts[alac->channels - 1];
Simple merge
@@@ -156,13 -159,11 +156,11 @@@ static int decode_frame(AVCodecContext 
  
      header      = AV_RL32(buf);
      version     = header & 0xff;
 +    is_pal      = buf[1] == 2 && version == 1;
      header_size = (header & (1<<30))? 8 : 4; /* bit 30 means pad to 8 bytes */
 -    prev_pic_bit = header & (1U << 31); /* bit 31 means same as previous pic */
  
      if (version > 5) {
-         av_log(avctx, AV_LOG_ERROR,
-                "This file is encoded with Fraps version %u. "
-                "This codec can only decode versions <= 5.\n", version);
+         avpriv_report_missing_feature(avctx, "Fraps version %u", version);
          return AVERROR_PATCHWELCOME;
      }
  
@@@ -1442,11 -1424,9 +1442,10 @@@ static int g2m_decode_frame(AVCodecCont
              }
              c->compression = bytestream2_get_be32(&bc);
              if (c->compression != 2 && c->compression != 3) {
-                 av_log(avctx, AV_LOG_ERROR,
-                        "Unknown compression method %d\n",
-                        c->compression);
+                 avpriv_report_missing_feature(avctx, "Compression method %d",
+                                               c->compression);
 -                return AVERROR_PATCHWELCOME;
 +                ret = AVERROR_PATCHWELCOME;
 +                goto header_fail;
              }
              c->tile_width  = bytestream2_get_be32(&bc);
              c->tile_height = bytestream2_get_be32(&bc);
                  g_mask = bytestream2_get_be32(&bc);
                  b_mask = bytestream2_get_be32(&bc);
                  if (r_mask != 0xFF0000 || g_mask != 0xFF00 || b_mask != 0xFF) {
-                     av_log(avctx, AV_LOG_ERROR,
-                            "Invalid or unsupported bitmasks: R=%"PRIX32", G=%"PRIX32", B=%"PRIX32"\n",
-                            r_mask, g_mask, b_mask);
+                     avpriv_report_missing_feature(avctx,
+                                                   "Bitmasks: R=%"PRIX32", G=%"PRIX32", B=%"PRIX32,
+                                                   r_mask, g_mask, b_mask);
 -                    return AVERROR_PATCHWELCOME;
 +                    ret = AVERROR_PATCHWELCOME;
 +                    goto header_fail;
                  }
              } else {
                  avpriv_request_sample(avctx, "bpp=%d", c->bpp);
Simple merge
@@@ -766,17 -697,11 +766,17 @@@ int ff_h264_decode_picture_parameter_se
          ret = AVERROR_INVALIDDATA;
          goto fail;
      }
 -    sps = (SPS*)ps->sps_list[pps->sps_id]->data;
 -
 -    if (sps->bit_depth_luma > 10) {
 -        avpriv_report_missing_feature(avctx, "Luma bit depth=%d (max=10)",
 -                                      sps->bit_depth_luma);
 +    sps = (const SPS*)ps->sps_list[pps->sps_id]->data;
 +    if (sps->bit_depth_luma > 14) {
 +        av_log(avctx, AV_LOG_ERROR,
 +               "Invalid luma bit depth=%d\n",
 +               sps->bit_depth_luma);
 +        ret = AVERROR_INVALIDDATA;
 +        goto fail;
 +    } else if (sps->bit_depth_luma == 11 || sps->bit_depth_luma == 13) {
-         av_log(avctx, AV_LOG_ERROR,
-                "Unimplemented luma bit depth=%d\n",
++        avpriv_report_missing_feature(avctx,
++               "Unimplemented luma bit depth=%d",
 +               sps->bit_depth_luma);
          ret = AVERROR_PATCHWELCOME;
          goto fail;
      }
Simple merge
Simple merge
@@@ -585,14 -373,7 +585,14 @@@ int ff_mjpeg_decode_sof(MJpegDecodeCont
          s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
          break;
      default:
 -        avpriv_report_missing_feature(s->avctx, "Pixel format 0x%x", pix_fmt_id);
 +unk_pixfmt:
-         av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x bits:%d\n", pix_fmt_id, s->bits);
++        avpriv_report_missing_feature(s->avctx, "Pixel format 0x%x bits:%d", pix_fmt_id, s->bits);
 +        memset(s->upscale_h, 0, sizeof(s->upscale_h));
 +        memset(s->upscale_v, 0, sizeof(s->upscale_v));
 +        return AVERROR_PATCHWELCOME;
 +    }
 +    if ((AV_RB32(s->upscale_h) || AV_RB32(s->upscale_v)) && s->avctx->lowres) {
-         av_log(s->avctx, AV_LOG_ERROR, "lowres not supported for weird subsampling\n");
++        avpriv_report_missing_feature(s->avctx, "Lowres for weird subsampling");
          return AVERROR_PATCHWELCOME;
      }
      if (s->ls) {
@@@ -803,11 -1526,11 +803,11 @@@ int ff_silk_decode_superframe(SilkConte
      /* read the LP-layer header bits */
      for (i = 0; i < coded_channels; i++) {
          for (j = 0; j < nb_frames; j++)
 -            active[i][j] = opus_rc_p2model(rc, 1);
 +            active[i][j] = ff_opus_rc_dec_log(rc, 1);
  
 -        redundancy[i] = opus_rc_p2model(rc, 1);
 +        redundancy[i] = ff_opus_rc_dec_log(rc, 1);
          if (redundancy[i]) {
-             av_log(s->avctx, AV_LOG_ERROR, "LBRR frames present; this is unsupported\n");
+             avpriv_report_missing_feature(s->avctx, "LBRR frames");
              return AVERROR_PATCHWELCOME;
          }
      }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -2548,17 -1947,11 +2548,16 @@@ static int matroska_read_header(AVForma
          ebml.max_size        > sizeof(uint64_t)  ||
          ebml.id_length       > sizeof(uint32_t)  ||
          ebml.doctype_version > 3) {
-         av_log(matroska->ctx, AV_LOG_ERROR,
-                "EBML header using unsupported features\n"
-                "(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",
-                ebml.version, ebml.doctype, ebml.doctype_version);
+         avpriv_report_missing_feature(matroska->ctx,
+                                       "EBML version %"PRIu64", doctype %s, doc version %"PRIu64,
+                                       ebml.version, ebml.doctype, ebml.doctype_version);
          ebml_free(ebml_syntax, &ebml);
          return AVERROR_PATCHWELCOME;
 +    } else if (ebml.doctype_version == 3) {
 +        av_log(matroska->ctx, AV_LOG_WARNING,
 +               "EBML header using unsupported features\n"
 +               "(EBML version %"PRIu64", doctype %s, doc version %"PRIu64")\n",
 +               ebml.version, ebml.doctype, ebml.doctype_version);
      }
      for (i = 0; i < FF_ARRAY_ELEMS(matroska_doctypes); i++)
          if (!strcmp(ebml.doctype, matroska_doctypes[i]))
Simple merge
Simple merge
@@@ -236,18 -229,8 +236,18 @@@ static int jpeg_parse_packet(AVFormatCo
      buf += 8;
      len -= 8;
  
 +    if (type & 0x40) {
 +        if (len < 4) {
 +            av_log(ctx, AV_LOG_ERROR, "Too short RTP/JPEG packet.\n");
 +            return AVERROR_INVALIDDATA;
 +        }
 +        dri = AV_RB16(buf);
 +        buf += 4;
 +        len -= 4;
 +        type &= ~0x40;
 +    }
      if (type > 1) {
-         av_log(ctx, AV_LOG_ERROR, "Unimplemented RTP/JPEG type %"PRIu8"\n", type);
+         avpriv_report_missing_feature(ctx, "RTP/JPEG type %"PRIu8, type);
          return AVERROR_PATCHWELCOME;
      }
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge