summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-01 15:14:52 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-01 15:14:52 +0100
commit64a0ed190efa4c8d1514a7d258ab533b340408d8 (patch)
tree9574586d8083d3a2184b221c3a15d697020f8844
parentbf92cd8178e0553a27971118e2b2b9e87e7b810b (diff)
parent13207484bba8a8b78b40d5a22da8c9c555429089 (diff)
Merge commit '13207484bba8a8b78b40d5a22da8c9c555429089'
* 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>
-rw-r--r--libavcodec/libvpxdec.c6
-rw-r--r--libavcodec/mjpegdec.c6
-rw-r--r--libavcodec/mpeg12dec.c6
-rw-r--r--libavcodec/mpeg4video_parser.c5
4 files changed, 16 insertions, 7 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index de32f402b1..897a68bdad 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -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;
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 5c25a07ac4..063b8fad9c 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -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;
}
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 5e320bdeae..8d8bc98ed0 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -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 &&
diff --git a/libavcodec/mpeg4video_parser.c b/libavcodec/mpeg4video_parser.c
index b3cbf919c5..78992b9c62 100644
--- a/libavcodec/mpeg4video_parser.c
+++ b/libavcodec/mpeg4video_parser.c
@@ -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);