Merge commit '13207484bba8a8b78b40d5a22da8c9c555429089'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Nov 2013 14:14:52 +0000 (15:14 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 1 Nov 2013 14:14:52 +0000 (15:14 +0100)
* commit '13207484bba8a8b78b40d5a22da8c9c555429089':
  mpeg4video_parser: stop using deprecated avcodec_set_dimensions
  mpeg12dec: stop using deprecated avcodec_set_dimensions
  mjpegdec: stop using deprecated avcodec_set_dimensions
  libvpxdec: stop using deprecated avcodec_set_dimensions

Conflicts:
libavcodec/mjpegdec.c
libavcodec/mpeg12dec.c
libavcodec/mpeg4video_parser.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/libvpxdec.c
libavcodec/mjpegdec.c
libavcodec/mpeg12dec.c
libavcodec/mpeg4video_parser.c

Simple merge
@@@ -215,12 -211,7 +215,12 @@@ int ff_mjpeg_decode_dht(MJpegDecodeCont
  
  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
  {
-     int len, nb_components, i, width, height, pix_fmt_id;
+     int len, nb_components, i, width, height, pix_fmt_id, ret;
 +    int h_count[MAX_COMPONENTS];
 +    int v_count[MAX_COMPONENTS];
 +
 +    s->cur_scan = 0;
 +    s->upscale_h = s->upscale_v = 0;
  
      /* XXX: verify len field validity */
      len     = get_bits(&s->gb, 16);
@@@ -1217,13 -1163,11 +1218,16 @@@ static int mpeg_decode_postinit(AVCodec
          if ((s->width == 0) || (s->height == 0))
              return -2;
  
-         avcodec_set_dimensions(avctx, s->width, s->height);
+         ret = ff_set_dimensions(avctx, s->width, s->height);
+         if (ret < 0)
+             return ret;
 -        avctx->bit_rate          = s->bit_rate;
 +        if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) {
 +            avctx->rc_max_rate = s->bit_rate;
 +        } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate &&
 +                   (s->bit_rate != 0x3FFFF*400 || s->vbv_delay != 0xFFFF)) {
 +            avctx->bit_rate = s->bit_rate;
 +        }
          s1->save_aspect_info     = s->aspect_ratio_info;
          s1->save_width           = s->width;
          s1->save_height          = s->height;
@@@ -20,8 -20,7 +20,9 @@@
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   */
  
 +#define UNCHECKED_BITSTREAM_READER 1
 +
+ #include "internal.h"
  #include "parser.h"
  #include "mpegvideo.h"
  #include "mpeg4video.h"
@@@ -91,15 -90,10 +92,17 @@@ static int av_mpeg4_decode_header(AVCod
      init_get_bits(gb, buf, 8 * buf_size);
      ret = ff_mpeg4_decode_picture_header(s, gb);
      if (s->width && (!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height)) {
-         avcodec_set_dimensions(avctx, s->width, s->height);
+         ret = ff_set_dimensions(avctx, s->width, s->height);
+         if (ret < 0)
+             return ret;
      }
 +    if((s1->flags & PARSER_FLAG_USE_CODEC_TS) && s->avctx->time_base.den>0 && ret>=0){
 +        av_assert1(s1->pts == AV_NOPTS_VALUE);
 +        av_assert1(s1->dts == AV_NOPTS_VALUE);
 +
 +        s1->pts = av_rescale_q(s->time, (AVRational){1, s->avctx->time_base.den}, (AVRational){1, 1200000});
 +    }
 +
      s1->pict_type= s->pict_type;
      pc->first_picture = 0;
      return ret;