diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 13:21:14 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 13:21:14 +0100 |
commit | 66f436adf5a30b19d2730a884417f2a0fd5e0925 (patch) | |
tree | 5ac586948d2e48e2d7761b2eaf4daba9fab4ddad /libavcodec/utils.c | |
parent | 51c5768cca3b69c6ff5e0e252d0c6c7e1e0feb82 (diff) | |
parent | 0f6c1d6d64c9f6255ea579dace27d0dd695f0213 (diff) | |
download | ffmpeg-66f436adf5a30b19d2730a884417f2a0fd5e0925.tar.gz |
Merge commit '0f6c1d6d64c9f6255ea579dace27d0dd695f0213'
* commit '0f6c1d6d64c9f6255ea579dace27d0dd695f0213':
lavc/utils: stop using deprecated avcodec_set_dimensions
Conflicts:
libavcodec/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e45ea5b25f..376fa6d8b1 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1230,20 +1230,22 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code if ((ret = av_opt_set_dict(avctx, &tmp)) < 0) goto free_and_end; - // only call avcodec_set_dimensions() for non H.264/VP6F codecs so as not to overwrite previously setup dimensions + // only call ff_set_dimensions() for non H.264/VP6F codecs so as not to overwrite previously setup dimensions if (!(avctx->coded_width && avctx->coded_height && avctx->width && avctx->height && (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_VP6F))) { if (avctx->coded_width && avctx->coded_height) - avcodec_set_dimensions(avctx, avctx->coded_width, avctx->coded_height); + ret = ff_set_dimensions(avctx, avctx->coded_width, avctx->coded_height); else if (avctx->width && avctx->height) - avcodec_set_dimensions(avctx, avctx->width, avctx->height); + ret = ff_set_dimensions(avctx, avctx->width, avctx->height); + if (ret < 0) + goto free_and_end; } if ((avctx->coded_width || avctx->coded_height || avctx->width || avctx->height) && ( av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx) < 0 || av_image_check_size(avctx->width, avctx->height, 0, avctx) < 0)) { av_log(avctx, AV_LOG_WARNING, "Ignoring invalid width/height values\n"); - avcodec_set_dimensions(avctx, 0, 0); + ff_set_dimensions(avctx, 0, 0); } /* if the decoder init function was already called previously, @@ -1970,7 +1972,7 @@ static int64_t guess_correct_pts(AVCodecContext *ctx, static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt) { - int size = 0; + int size = 0, ret; const uint8_t *data; uint32_t flags; @@ -2013,8 +2015,10 @@ static int apply_param_change(AVCodecContext *avctx, AVPacket *avpkt) goto fail; avctx->width = bytestream_get_le32(&data); avctx->height = bytestream_get_le32(&data); - avcodec_set_dimensions(avctx, avctx->width, avctx->height); size -= 8; + ret = ff_set_dimensions(avctx, avctx->width, avctx->height); + if (ret < 0) + return ret; } return 0; |