* 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>tags/n2.2-rc1
@@ -90,9 +90,9 @@ static int vp8_decode(AVCodecContext *avctx, | |||||
if ((int) img->d_w != avctx->width || (int) img->d_h != avctx->height) { | 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", | av_log(avctx, AV_LOG_INFO, "dimension change! %dx%d -> %dx%d\n", | ||||
avctx->width, avctx->height, img->d_w, img->d_h); | 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) | if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) | ||||
return ret; | return ret; | ||||
@@ -215,7 +215,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s) | |||||
int ff_mjpeg_decode_sof(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 h_count[MAX_COMPONENTS]; | ||||
int v_count[MAX_COMPONENTS]; | int v_count[MAX_COMPONENTS]; | ||||
@@ -326,7 +326,9 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) | |||||
height *= 2; | 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; | s->first_picture = 0; | ||||
} | } | ||||
@@ -1195,6 +1195,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) | |||||
Mpeg1Context *s1 = avctx->priv_data; | Mpeg1Context *s1 = avctx->priv_data; | ||||
MpegEncContext *s = &s1->mpeg_enc_ctx; | MpegEncContext *s = &s1->mpeg_enc_ctx; | ||||
uint8_t old_permutation[64]; | uint8_t old_permutation[64]; | ||||
int ret; | |||||
if ((s1->mpeg_enc_ctx_allocated == 0) || | if ((s1->mpeg_enc_ctx_allocated == 0) || | ||||
avctx->coded_width != s->width || | avctx->coded_width != s->width || | ||||
@@ -1217,7 +1218,10 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) | |||||
if ((s->width == 0) || (s->height == 0)) | if ((s->width == 0) || (s->height == 0)) | ||||
return -2; | 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) { | if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && s->bit_rate) { | ||||
avctx->rc_max_rate = s->bit_rate; | avctx->rc_max_rate = s->bit_rate; | ||||
} else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && | } else if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && s->bit_rate && | ||||
@@ -22,6 +22,7 @@ | |||||
#define UNCHECKED_BITSTREAM_READER 1 | #define UNCHECKED_BITSTREAM_READER 1 | ||||
#include "internal.h" | |||||
#include "parser.h" | #include "parser.h" | ||||
#include "mpegvideo.h" | #include "mpegvideo.h" | ||||
#include "mpeg4video.h" | #include "mpeg4video.h" | ||||
@@ -91,7 +92,9 @@ static int av_mpeg4_decode_header(AVCodecParserContext *s1, | |||||
init_get_bits(gb, buf, 8 * buf_size); | init_get_bits(gb, buf, 8 * buf_size); | ||||
ret = ff_mpeg4_decode_picture_header(s, gb); | ret = ff_mpeg4_decode_picture_header(s, gb); | ||||
if (s->width && (!avctx->width || !avctx->height || !avctx->coded_width || !avctx->coded_height)) { | 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){ | 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->pts == AV_NOPTS_VALUE); | ||||