1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

rv34: use ff_MPV_common_frame_size_change()

Specialised functionality for size changes with the advantage of
supporting frame size changes during frame-based multithreading.
This commit is contained in:
Janne Grunau 2012-09-05 20:49:18 +02:00
parent 435c0b87d2
commit b16d001b62

View File

@ -1533,10 +1533,9 @@ int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecConte
return 0; return 0;
if (s->height != s1->height || s->width != s1->width) { if (s->height != s1->height || s->width != s1->width) {
ff_MPV_common_end(s);
s->height = s1->height; s->height = s1->height;
s->width = s1->width; s->width = s1->width;
if ((err = ff_MPV_common_init(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)
return err; return err;
@ -1655,20 +1654,13 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
if (s->width != si.width || s->height != si.height) { if (s->width != si.width || s->height != si.height) {
int err; int err;
if (HAVE_THREADS &&
(s->avctx->active_thread_type & FF_THREAD_FRAME)) {
av_log_missing_feature(s->avctx, "Width/height changing with "
"frame threading is", 0);
return AVERROR_PATCHWELCOME;
}
av_log(s->avctx, AV_LOG_WARNING, "Changing dimensions to %dx%d\n", av_log(s->avctx, AV_LOG_WARNING, "Changing dimensions to %dx%d\n",
si.width, si.height); si.width, si.height);
ff_MPV_common_end(s);
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); avcodec_set_dimensions(s->avctx, s->width, s->height);
if ((err = ff_MPV_common_init(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)
return err; return err;