diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-10-27 09:24:22 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-10-31 20:14:14 +0100 |
commit | 7644f5a80787c9b608b82873604805d7e38a6a18 (patch) | |
tree | 13ab56556d67d4e4fce64ffa19c6f1e45cf2fed3 /libavcodec/utils.c | |
parent | 28096e0a806e57376541e6222d315619906e3c55 (diff) |
lavc: replace avcodec_set_dimensions with ff_set_dimensions
avcodec_set_dimensions() is supposed to be an internal utility function,
there is no reason whatsoever for it to be public. Therefore deprecate
it.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d14d4f4472..1e0026d255 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -152,12 +152,23 @@ unsigned avcodec_get_edge_width(void) return EDGE_WIDTH; } +#if FF_API_SET_DIMENSIONS void avcodec_set_dimensions(AVCodecContext *s, int width, int height) { - s->coded_width = width; - s->coded_height = height; - s->width = width; - s->height = height; + ff_set_dimensions(s, width, height); +} +#endif + +int ff_set_dimensions(AVCodecContext *s, int width, int height) +{ + int ret = av_image_check_size(width, height, 0, s); + + if (ret < 0) + width = height = 0; + s->width = s->coded_width = width; + s->height = s->coded_height = height; + + return ret; } #if HAVE_NEON || ARCH_PPC || HAVE_MMX |