mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
Merge commit 'c755870d52c8c29676e5ba7ee9557adf4a7ca934'
* commit 'c755870d52c8c29676e5ba7ee9557adf4a7ca934': sgidec: stop using deprecated avcodec_set_dimensions rv34: stop using deprecated avcodec_set_dimensions rv10: stop using deprecated avcodec_set_dimensions ptx: stop using deprecated avcodec_set_dimensions Conflicts: libavcodec/ptx.c libavcodec/rv10.c libavcodec/sgidec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
7630e564ca
@ -55,10 +55,9 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
|
|
||||||
buf += offset;
|
buf += offset;
|
||||||
|
|
||||||
if ((ret = av_image_check_size(w, h, 0, avctx)) < 0)
|
if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
if (w != avctx->width || h != avctx->height)
|
|
||||||
avcodec_set_dimensions(avctx, w, h);
|
|
||||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "libavutil/imgutils.h"
|
#include "libavutil/imgutils.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "error_resilience.h"
|
#include "error_resilience.h"
|
||||||
|
#include "internal.h"
|
||||||
#include "mpegvideo.h"
|
#include "mpegvideo.h"
|
||||||
#include "mpeg4video.h"
|
#include "mpeg4video.h"
|
||||||
#include "h263.h"
|
#include "h263.h"
|
||||||
@ -363,8 +364,6 @@ static int rv20_decode_picture_header(RVDecContext *rv)
|
|||||||
AVRational old_aspect = s->avctx->sample_aspect_ratio;
|
AVRational old_aspect = s->avctx->sample_aspect_ratio;
|
||||||
av_log(s->avctx, AV_LOG_DEBUG,
|
av_log(s->avctx, AV_LOG_DEBUG,
|
||||||
"attempting to change resolution to %dx%d\n", new_w, new_h);
|
"attempting to change resolution to %dx%d\n", new_w, new_h);
|
||||||
if (av_image_check_size(new_w, new_h, 0, s->avctx) < 0)
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
ff_MPV_common_end(s);
|
ff_MPV_common_end(s);
|
||||||
|
|
||||||
// attempt to keep aspect during typical resolution switches
|
// attempt to keep aspect during typical resolution switches
|
||||||
@ -374,7 +373,11 @@ static int rv20_decode_picture_header(RVDecContext *rv)
|
|||||||
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){2, 1});
|
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){2, 1});
|
||||||
if (new_w * s->height == 2 * new_h * s->width)
|
if (new_w * s->height == 2 * new_h * s->width)
|
||||||
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){1, 2});
|
s->avctx->sample_aspect_ratio = av_mul_q(old_aspect, (AVRational){1, 2});
|
||||||
avcodec_set_dimensions(s->avctx, new_w, new_h);
|
|
||||||
|
ret = ff_set_dimensions(s->avctx, new_w, new_h);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
s->width = new_w;
|
s->width = new_w;
|
||||||
s->height = new_h;
|
s->height = new_h;
|
||||||
if ((ret = ff_MPV_common_init(s)) < 0)
|
if ((ret = ff_MPV_common_init(s)) < 0)
|
||||||
|
@ -1693,7 +1693,11 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
|
|||||||
si.width, si.height);
|
si.width, si.height);
|
||||||
s->width = si.width;
|
s->width = si.width;
|
||||||
s->height = si.height;
|
s->height = si.height;
|
||||||
avcodec_set_dimensions(s->avctx, s->width, s->height);
|
|
||||||
|
err = ff_set_dimensions(s->avctx, s->width, s->height);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
|
||||||
if ((err = ff_MPV_common_frame_size_change(s)) < 0)
|
if ((err = ff_MPV_common_frame_size_change(s)) < 0)
|
||||||
return err;
|
return err;
|
||||||
if ((err = rv34_decoder_realloc(r)) < 0)
|
if ((err = rv34_decoder_realloc(r)) < 0)
|
||||||
|
@ -202,9 +202,9 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (av_image_check_size(s->width, s->height, 0, avctx))
|
ret = ff_set_dimensions(avctx, s->width, s->height);
|
||||||
return AVERROR_INVALIDDATA;
|
if (ret < 0)
|
||||||
avcodec_set_dimensions(avctx, s->width, s->height);
|
return ret;
|
||||||
|
|
||||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user