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

index ae1204bce1529a2460c9b4580024616e99105bae,83d777c760a8d6742e8b5698ae819df1e3e00ceb..d6bd21ba1351ac5294bd2f48e616603386ec2e75
@@@ -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
index d5fb9192470981aaff7114559a5dcf78b72a5439,55051ffe7e1624abed58ad58cb68990747cd2ac1..7a7673f73fe6d7fb4142724af6cc21530fddbd01
@@@ -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;
      }
  
index b0af3ec046ae8a1b5713ccc263fc73544bb3baeb,7e90916274dd99e7f00b7d44c3bb60612fd49bd2..10b6808f813b1dfb1964cd59df5134e468d32c9b
@@@ -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
index b78ad251f5c1ed2a19e4ecad1a8bdb959f34e5ec,37c3be1cb99afef712f87baf9a28e3a068be130f..7e66ed72247c5ab9f36d09dc9f1d505e57763eeb
@@@ -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
index 1973132bc63c6c035f50249c32211f44db49546b,a4a6c63411d82305c6e0a1c163be28eb98121e92..5470b661c3781c7ea023a0e0c06dab7276d6b755
@@@ -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) {
index 4561b5a998fb71a3d5d6333dbbd101c71f2c88c7,5db1b26c6f8074eb12711b3664e0e9feb9e472dc..bfaf1d7d00be6c8cf6645cd6475cd0b9f739f7c6
@@@ -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
index 2e2a814b4ff30c7abf5948d228ed314144da1637,80167309650c9c8df499b49ea784b0c2aaa2f09a..3ec16365847a9498f47ed7f26feec62387d1db94
@@@ -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
index 05dd17205c9903cd61b105cfa8e8130dec641fdb,c3e5c8dc9ff4d0a9386de151089cfe7e28bc6554..465d9bc29211998f654246363175dffad43bde38
@@@ -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