Commit 64a0ed19 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '13207484'

* commit '13207484':
  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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents bf92cd81 13207484
......@@ -90,9 +90,9 @@ static int vp8_decode(AVCodecContext *avctx,
if ((int) img->d_w != avctx->width || (int) img->d_h != avctx->height) {
av_log(avctx, AV_LOG_INFO, "dimension change! %dx%d -> %dx%d\n",
avctx->width, avctx->height, img->d_w, img->d_h);
if (av_image_check_size(img->d_w, img->d_h, 0, avctx))
return AVERROR_INVALIDDATA;
avcodec_set_dimensions(avctx, img->d_w, img->d_h);
ret = ff_set_dimensions(avctx, img->d_w, img->d_h);
if (ret < 0)
return ret;
}
if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
return ret;
......
......@@ -215,7 +215,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
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];
......@@ -326,7 +326,9 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
height *= 2;
}
avcodec_set_dimensions(s->avctx, width, height);
ret = ff_set_dimensions(s->avctx, width, height);
if (ret < 0)
return ret;
s->first_picture = 0;
}
......
......@@ -1195,6 +1195,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
uint8_t old_permutation[64];
int ret;
if ((s1->mpeg_enc_ctx_allocated == 0) ||
avctx->coded_width != s->width ||
......@@ -1217,7 +1218,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
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;
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 &&
......
......@@ -22,6 +22,7 @@
#define UNCHECKED_BITSTREAM_READER 1
#include "internal.h"
#include "parser.h"
#include "mpegvideo.h"
#include "mpeg4video.h"
......@@ -91,7 +92,9 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1,
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment