summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-07-25 16:20:50 +0200
committerAnton Khirnov <anton@khirnov.net>2016-07-25 16:20:50 +0200
commit05b001ab8dacfd37561d50310695169ee6ea3446 (patch)
treeddcc3bfe8b8ffdc8e324cfb1183673c291f2e057
parent6f690f7b7887e7711679de9147baaed09f77254e (diff)
cfhd: set the dimensions/pixel format unconditionally for each framecfhd
-rw-r--r--libavcodec/cfhd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 9ab9304f90..ce57ac2da6 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -176,13 +176,6 @@ static int alloc_buffers(CFHDContext *s)
int chroma_x_shift, chroma_y_shift;
unsigned k;
- if ((ret = ff_set_dimensions(s->avctx, s->coded_width, s->coded_height)) < 0)
- return ret;
- if (s->cropped_height)
- s->avctx->height = s->cropped_height;
-
- s->avctx->pix_fmt = s->coded_format;
-
if ((ret = av_pix_fmt_get_chroma_sub_sample(s->coded_format,
&chroma_x_shift,
&chroma_y_shift)) < 0)
@@ -709,6 +702,14 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
return AVERROR_INVALIDDATA;
}
+ ret = ff_set_dimensions(s->avctx, s->coded_width, s->coded_height);
+ if (ret < 0)
+ return ret;
+ if (s->cropped_height)
+ s->avctx->height = s->cropped_height;
+
+ s->avctx->pix_fmt = s->coded_format;
+
if (s->a_width != s->coded_width || s->a_height != s->coded_height ||
s->a_format != s->coded_format) {
free_buffers(s);