diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 13:07:15 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-01 13:07:15 +0100 |
commit | 7b91e9cf5dc7b46216aa4da79943aecf9425ab04 (patch) | |
tree | 24e303e1b752801434c49e4516fc3d02a55c500f /libavcodec/utils.c | |
parent | f62dfed3de400fa02f770ea8a0b750fc297336bf (diff) | |
parent | 7644f5a80787c9b608b82873604805d7e38a6a18 (diff) | |
download | ffmpeg-7b91e9cf5dc7b46216aa4da79943aecf9425ab04.tar.gz |
Merge commit '7644f5a80787c9b608b82873604805d7e38a6a18'
* commit '7644f5a80787c9b608b82873604805d7e38a6a18':
lavc: replace avcodec_set_dimensions with ff_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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7ea0084dc8..e45ea5b25f 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -230,12 +230,26 @@ unsigned avcodec_get_edge_width(void) return EDGE_WIDTH; } +#if FF_API_SET_DIMENSIONS void avcodec_set_dimensions(AVCodecContext *s, int width, int 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->coded_width = width; s->coded_height = height; s->width = FF_CEIL_RSHIFT(width, s->lowres); s->height = FF_CEIL_RSHIFT(height, s->lowres); + + return ret; } #if HAVE_NEON || ARCH_PPC || HAVE_MMX |